Skip to content

feat: install mkisofs to create macos dmg images (goreleaser-pro) #9

feat: install mkisofs to create macos dmg images (goreleaser-pro)

feat: install mkisofs to create macos dmg images (goreleaser-pro) #9

Workflow file for this run

name: CI
on:
schedule:
- cron: '0 1 * * 4' # at 01:00 on thursday
workflow_dispatch:
inputs:
release-tag:
description: goreleaser release tag
default: nightly
required: true
type: string
push:
branches: [ main ]
paths:
- .github/workflows/ci.yml
- Dockerfile
- entrypoint.sh
pull_request:
branches: [ main ]
paths:
- .github/workflows/ci.yml
- Dockerfile
- entrypoint.sh
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: goreleaser-rust-cross
- image: goreleaser-rust-cross-pro
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- uses: actions/checkout@v4
- if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@main
- uses: docker/[email protected]
- if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set goreleaser distribution and version
id: goreleaser
run: |
# Set goreleaser distribution
if [[ "${{ matrix.image }}" == "goreleaser-rust-cross-pro" ]]; then
is_pro=true
echo "distribution=goreleaser-pro" >> $GITHUB_OUTPUT
else
echo "distribution=goreleaser" >> $GITHUB_OUTPUT
fi
# Set goreleaser version
if [[ $is_pro == true && "${{ startsWith(inputs.release-tag, 'v') }}" == true ]]; then
echo "version=${{ inputs.release-tag }}-pro" >> $GITHUB_OUTPUT
else
echo "version=${{ inputs.release-tag || 'nightly' }}" >> $GITHUB_OUTPUT
fi
- id: meta
uses: docker/[email protected]
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
tags: |
type=raw,value=${{ steps.goreleaser.outputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }}
type=ref,event=branch,enable=${{ github.event_name == 'push' }}
type=ref,prefix=pr-,event=pr,enable=${{ github.event_name == 'pull_request' }}
type=schedule,pattern=nightly,enable=${{ github.event_name == 'schedule' }}
flavor: latest=${{ startsWith(inputs.release-tag, 'v') }}
- id: build-and-push
uses: docker/[email protected]
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64 # ,linux/arm64
build-args: |
GORELEASER_VERSION=${{ steps.goreleaser.outputs.version }}
GORELEASER_DISTRIBUTION=${{ steps.goreleaser.outputs.distribution }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- if: ${{ github.event_name != 'pull_request' }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}