Skip to content

Commit d42d17e

Browse files
committed
chore: update GitHub Actions workflow for Go package
- Simplified the trigger for the workflow to only respond to push events. - Cleaned up formatting in the matrix configuration for Go versions and changed directories. - Added a new release job to create GitHub releases based on version tags, enhancing the deployment process. These changes streamline the CI/CD process and improve the release management for the Go package.
1 parent 78dc305 commit d42d17e

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

.github/workflows/gopackage.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Go build
22

3-
on:
4-
push:
5-
pull_request:
6-
branches:
7-
- 'master'
3+
on: [push]
84

95
jobs:
106
test:
@@ -13,16 +9,16 @@ jobs:
139
fail-fast: false
1410
max-parallel: 5
1511
matrix:
16-
go-version: [ '1.18', '1.19', '1.20', '1.21', '1.22' ]
17-
changed-dir: [ "qase-api-client", "qase-api-v2-client", "pkg/qase-go" ]
12+
go-version: ["1.18", "1.19", "1.20", "1.21", "1.22"]
13+
changed-dir: ["qase-api-client", "qase-api-v2-client", "pkg/qase-go"]
1814
name: Project ${{ matrix.changed-dir }} - Go ${{ matrix.go-version }}
1915
steps:
2016
- uses: actions/checkout@v4
2117

2218
- uses: dorny/paths-filter@v3
2319
id: filter
2420
with:
25-
list-files: 'shell'
21+
list-files: "shell"
2622
filters: |
2723
changes:
2824
- '${{ matrix.changed-dir }}/**'
@@ -47,3 +43,26 @@ jobs:
4743
if: steps.filter.outputs.changes == 'true'
4844
working-directory: ./${{ matrix.changed-dir }}
4945
run: go test -v -cover ./...
46+
47+
release:
48+
runs-on: ubuntu-latest
49+
if: contains(github.ref, '/v') && startsWith(github.ref, 'refs/tags/')
50+
permissions:
51+
contents: write
52+
steps:
53+
- uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
57+
- name: Get tag name
58+
id: tag
59+
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
60+
61+
- name: Create Release
62+
uses: softprops/action-gh-release@v1
63+
with:
64+
tag_name: ${{ steps.tag.outputs.TAG_NAME }}
65+
name: ${{ steps.tag.outputs.TAG_NAME }}
66+
generate_release_notes: true
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)