dev-release #54
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
name: dev-release | |
on: | |
schedule: | |
- cron: '0 16 * * 0' # at 16:00 on Sunday (UTC) | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Weekly Release Notation Binaries | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
go-version: ['1.20'] | |
fail-fast: true | |
steps: | |
- name: Set up Go ${{ matrix.go-version }} | |
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
fetch-depth: 0 | |
- name: Set Git User | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Create Version Tag | |
run: | | |
# get project version: <SemVer>.dev.<YYYYMMDD> | |
export TAG_VERSION=`cat ./internal/version/version.go | grep "Version = " | awk -F '"' '{print $2}'`.dev.`date +%Y%m%d` | |
# create new tag | |
git tag -af $TAG_VERSION -m "For weekly build" | |
git push origin $TAG_VERSION | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release -f ./.dev.goreleaser.yml --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Delete old dev release | |
uses: dev-drprasad/delete-older-releases@653dc03d96473ac9e585c68c8bf5aaccb0dadb61 # v0.2.1 | |
with: | |
keep_latest: 1 | |
delete_tag_pattern: ".dev." | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |