Skip to content

grr github

grr github #13

Workflow file for this run

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
REPO_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}
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 $REPO_NAME
docker save $REPO_NAME -o "$REPO_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"