Merge pull request #272 from lets-cli/fix-goreleaser-dry-run #50
Workflow file for this run
This file contains 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
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0.0, v1.0.0-rc1 | |
name: Release | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Unshallow | |
run: git fetch --prune --unshallow | |
- name: Set up Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.23.x | |
- name: Run GoReleaser (dry run) | |
env: | |
PACKAGE_NAME: github.com/lets-cli/lets | |
GOLANG_CROSS_VERSION: v1.23 | |
run: | | |
docker run \ | |
--rm \ | |
-e CGO_ENABLED=1 \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v `pwd`:/go/src/${PACKAGE_NAME}\ | |
-v `pwd`/sysroot:/sysroot \ | |
-w /go/src/${PACKAGE_NAME} \ | |
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ | |
--clean --skip=validate --skip=publish | |
- name: Setup release environment | |
run: |- | |
echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' > .release-env | |
echo 'HOMEBREW_TAP_GITHUB_TOKEN=${{secrets.GH_PAT}}' > .release-env | |
echo 'AUR_GITHUB_TOKEN=${{secrets.AUR_SSH_PRIVATE_KEY}}' > .release-env | |
- name: Run GoReleaser | |
env: | |
PACKAGE_NAME: github.com/lets-cli/lets | |
GOLANG_CROSS_VERSION: v1.23 | |
run: | | |
if [ ! -f ".release-env" ]; then | |
echo ".release-env is required for release"; | |
exit 1; | |
fi | |
docker run \ | |
--rm \ | |
-e CGO_ENABLED=1 \ | |
--env-file .release-env \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v `pwd`:/go/src/${PACKAGE_NAME}\ | |
-v `pwd`/sysroot:/sysroot \ | |
-w /go/src/${PACKAGE_NAME} \ | |
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ | |
release --clean |