Skip to content

Release version 0.6

Release version 0.6 #8

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "${GITHUB_ENV}"
- name: Build all platforms
run: make build-all
- name: Install go-licenses
run: go install github.com/google/go-licenses@v1.6.0
- name: Create release archives
run: |
mkdir -p dist/tmp
# POSIX
for arch in linux-{amd64,arm64,riscv64} darwin-{amd64,arm64}; do
GOOS=${arch%-*} make licenses
ARCHIVE_NAME="ccache-storage-http-go-${VERSION}-${arch}"
mkdir -p dist/tmp/"${ARCHIVE_NAME}"
cp ccache-storage-http-${arch} dist/tmp/"${ARCHIVE_NAME}"/ccache-storage-http
cp LICENSE README.md THIRD_PARTY_LICENSES.txt dist/tmp/"${ARCHIVE_NAME}"/
tar -caf dist/"${ARCHIVE_NAME}".tar.gz -C dist/tmp "${ARCHIVE_NAME}"
rm -r dist/tmp/"${ARCHIVE_NAME}"
done
# Windows
for arch in windows-{amd64,arm64}; do
GOOS=windows make licenses
ARCHIVE_NAME="ccache-storage-http-go-${VERSION}-${arch}"
mkdir -p dist/tmp/"${ARCHIVE_NAME}"
cp ccache-storage-http-${arch}.exe dist/tmp/"${ARCHIVE_NAME}"/ccache-storage-http.exe
cp LICENSE README.md THIRD_PARTY_LICENSES.txt dist/tmp/"${ARCHIVE_NAME}"/
cd dist/tmp
zip -r ../"${ARCHIVE_NAME}".zip "${ARCHIVE_NAME}"
cd ../..
rm -r dist/tmp/"${ARCHIVE_NAME}"
done
rmdir dist/tmp
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
NOTES=$(awk -v ver="## [${VERSION}]" 'index($0, ver) == 1{found=1; next} found && /^## \[/{exit} found{print}' CHANGELOG.md)
gh release create "v${VERSION}" \
--title "${VERSION}" \
--notes "${NOTES}" \
dist/*