Skip to content

Commit

Permalink
Move Release action to separate workflow
Browse files Browse the repository at this point in the history
Keeping the release in the same workflow only triggers the release if the tag and commit are pushed simultaneously. A separate action should be easier if I want to run through CI before tagging.
  • Loading branch information
carpeliam committed Jan 20, 2025
1 parent 0284d66 commit 6ea0dee
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,3 @@ jobs:

- name: Test
run: go test -v ./...

release:
runs-on: macos-latest
if: startsWith(github.ref, 'refs/tags/')
needs: test
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.1

- name: Build
run: go build -v -o sc .

- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
sc
LICENSE
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
name: Create Release
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.1

- name: Build
run: go build -v -o sc .

- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
sc
LICENSE

0 comments on commit 6ea0dee

Please sign in to comment.