no comment #11
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| env: | |
| ARCH: | | |
| amd64 | |
| arm64 | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # NB: actions/checkout quietly fetches all tags as lightweight tags, | |
| # even if they’re annotated upstream. That, of course, prevents use | |
| # of the tag message as release notes. This works around that. | |
| # | |
| # See https://github.com/actions/checkout/issues/290 for details. | |
| - name: Fetch tags | |
| run: git fetch --tags --force | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| - name: Build | |
| run: | | |
| set -o errexit | |
| TAG_NAME=$(git describe --exact-match) | |
| git tag --list --format='%(contents)' "$TAG_NAME" > RELEASE-NOTES | |
| for cur_arch in $ARCH; do | |
| docker build . --platform linux/$cur_arch -t ${{ github.repository_name }} | |
| docker save ${{ github.repository_name }} -o "${{ github.repository_name }}-$TAG_NAME-$cur_arch.tar" | |
| done | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| body_path: RELEASE-NOTES | |
| files: "*.tar" |