Release #26
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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| build_number: | |
| description: Extra build number (for multiple releases in one day) | |
| required: true | |
| default: 0 | |
| permissions: | |
| contents: write | |
| attestations: write | |
| id-token: write | |
| jobs: | |
| tag: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.tag.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: tag | |
| run: | | |
| VERSION=v$(date +%Y.%m.%d) | |
| if [ "${{ inputs.build_number }}" != "0" ]; then VERSION="$VERSION-${{ inputs.build_number }}"; fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| git config user.name github-actions | |
| git config user.email [email protected] | |
| git tag -a $VERSION -m "Release $VERSION" | |
| git push --tags | |
| test-bazel: | |
| needs: [tag] | |
| uses: ./.github/workflows/bazel.yml | |
| with: | |
| ref: ${{ needs.tag.outputs.version }} | |
| test-cmake: | |
| needs: [tag] | |
| uses: ./.github/workflows/cmake.yml | |
| with: | |
| ref: ${{ needs.tag.outputs.version }} | |
| generate-version-info: | |
| needs: [tag] | |
| uses: ./.github/workflows/version-info.yml | |
| with: | |
| ref: ${{ needs.tag.outputs.version }} | |
| release: | |
| needs: [tag, test-bazel, test-cmake, generate-version-info] | |
| uses: bazel-contrib/.github/.github/workflows/[email protected] | |
| with: | |
| bazel_test_command: true || # we already tested the tag | |
| mount_bazel_caches: false | |
| prerelease: false | |
| release_files: "*_portable_cc_toolchain-*.tar.gz" | |
| tag_name: ${{ needs.tag.outputs.version }} | |
| publish: | |
| needs: [tag, release] | |
| uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected] | |
| with: | |
| tag_name: ${{ needs.tag.outputs.version }} | |
| registry_fork: CACI-International/bazel-central-registry | |
| attest: true | |
| permissions: | |
| contents: write | |
| # Necessary if attest:true | |
| id-token: write | |
| # Necessary if attest:true | |
| attestations: write | |
| secrets: | |
| # Necessary to push to the BCR fork, and to open a pull request against a registry | |
| publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }} |