Skip to content

Commit

Permalink
feat(ci): introduce prerelease workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
omissis committed Oct 7, 2023
1 parent fa2bdbf commit d84da8c
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/prerelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: prerelease

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"

permissions:
contents: write

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Fetch all tags
run: git fetch --force --tags
- name: Cleanup pre-release tags
run: git tag -l | grep -E "v[0-9]+.[0-9]+.[0-9]+-(alpha|beta|rc).[0-9]+" | xargs git tag -d
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: "^1.21.2"
- name: Setup workspace
run: cp go.work.dist go.work
- name: Run GoReleaser for release
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: "1.21.2"
args: release --debug --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GO_VERSION: "1.21.2"

0 comments on commit d84da8c

Please sign in to comment.