feat(release): publish CLI archives on GitHub #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| concurrency: | |
| group: sysbox-stable-release | |
| cancel-in-progress: false | |
| on: | |
| push: | |
| tags: ['v*.*.*'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Validate release tag and source | |
| run: | | |
| source scripts/release/lib.sh | |
| require_release_repo "${GITHUB_REF_NAME}" | |
| - name: Full CI gate | |
| run: | | |
| go vet ./... | |
| go test ./... | |
| CGO_ENABLED=1 go test -race ./pkg/buildinfo ./cmd/sysbox/commands ./pkg/runtime ./pkg/state ./pkg/provider/docker ./pkg/provider/libvirt ./pkg/provider/firecracker | |
| make ci | |
| make release-test | |
| make release-workflow-test | |
| publish: | |
| needs: verify | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| env: | |
| OCI_IMAGE: ghcr.io/pku-asal/sysbox | |
| RELEASE_REPOSITORY: PKU-ASAL/sysbox | |
| SOURCE_URL: https://github.com/PKU-ASAL/sysbox | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 | |
| - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 | |
| - name: Registry login | |
| env: | |
| GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| test -n "${GHCR_TOKEN}" | |
| printf '%s' "${GHCR_TOKEN}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin | |
| - name: Build and verify release artifacts | |
| run: | | |
| scripts/release/build.sh --tag "${GITHUB_REF_NAME}" --output dist | |
| scripts/release/verify.sh dist | |
| - name: Publish or reconcile runtime OCI image | |
| env: | |
| BUILD_METADATA: dist/build-metadata.json | |
| run: scripts/release/oci.sh reconcile --tag "${GITHUB_REF_NAME}" --image "${OCI_IMAGE}" | |
| - name: Publish or audit GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: scripts/release/github.sh reconcile --tag "${GITHUB_REF_NAME}" --dist dist --repository "${RELEASE_REPOSITORY}" | |
| - name: Logout from registry | |
| if: always() | |
| run: docker logout ghcr.io || true |