Skip to content

Commit 5ad1ae7

Browse files
committed
Update GitHub Actions workflows and issue template for improved functionality and clarity. Upgraded action versions, added permissions, and enhanced the bug report template with the latest subenum version. Adjusted build and deployment steps for better artifact handling and cross-platform support.
1 parent ebc18cb commit 5ad1ae7

File tree

3 files changed

+43
-32
lines changed

3 files changed

+43
-32
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If applicable, add screenshots or copy the terminal output to help explain your
2626
**Environment (please complete the following information):**
2727
- OS: [e.g. Ubuntu 22.04, Windows 11, macOS 13.0]
2828
- Go Version: [e.g. 1.22.0]
29-
- subenum Version: [e.g. 0.2.0]
29+
- subenum Version: [e.g. 0.3.0]
3030

3131
**Additional context**
3232
Add any other context about the problem here.

.github/workflows/go.yml

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

9-
jobs:
9+
permissions:
10+
contents: write
1011

12+
jobs:
1113
build:
1214
runs-on: ubuntu-latest
1315
steps:
14-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1517

1618
- name: Set up Go
17-
uses: actions/setup-go@v4
19+
uses: actions/setup-go@v5
1820
with:
1921
go-version: '1.22'
20-
cache: true
2122

2223
- name: Verify dependencies
2324
run: go mod verify
@@ -26,48 +27,66 @@ jobs:
2627
run: go build -v -buildvcs=false ./...
2728

2829
- name: Test
29-
run: go test -v ./...
30-
30+
run: go test -v -race ./...
31+
3132
- name: Run golangci-lint
32-
uses: golangci/golangci-lint-action@v3
33+
uses: golangci/golangci-lint-action@v6
3334
with:
3435
version: latest
3536

36-
# Create a job for each OS (Windows, macOS, Linux)
3737
release:
3838
needs: build
3939
if: startsWith(github.ref, 'refs/tags/v')
4040
strategy:
4141
matrix:
42-
os: [ubuntu-latest, windows-latest, macos-latest]
4342
include:
4443
- os: ubuntu-latest
44+
goos: linux
45+
goarch: amd64
4546
artifact_name: subenum
4647
asset_name: subenum-linux-amd64
4748
- os: windows-latest
49+
goos: windows
50+
goarch: amd64
4851
artifact_name: subenum.exe
4952
asset_name: subenum-windows-amd64.exe
5053
- os: macos-latest
54+
goos: darwin
55+
goarch: arm64
56+
artifact_name: subenum
57+
asset_name: subenum-macos-arm64
58+
- os: ubuntu-latest
59+
goos: darwin
60+
goarch: amd64
5161
artifact_name: subenum
5262
asset_name: subenum-macos-amd64
53-
63+
5464
runs-on: ${{ matrix.os }}
5565

5666
steps:
57-
- uses: actions/checkout@v3
58-
67+
- uses: actions/checkout@v4
68+
5969
- name: Set up Go
60-
uses: actions/setup-go@v4
70+
uses: actions/setup-go@v5
6171
with:
6272
go-version: '1.22'
63-
cache: true
64-
73+
6574
- name: Build
75+
env:
76+
GOOS: ${{ matrix.goos }}
77+
GOARCH: ${{ matrix.goarch }}
6678
run: go build -v -buildvcs=false -o ${{ matrix.artifact_name }}
67-
79+
80+
- name: Rename for release
81+
shell: bash
82+
run: |
83+
if [ "${{ matrix.artifact_name }}" != "${{ matrix.asset_name }}" ]; then
84+
cp ${{ matrix.artifact_name }} ${{ matrix.asset_name }}
85+
fi
86+
6887
- name: Upload binaries to release
69-
uses: softprops/action-gh-release@v1
88+
uses: softprops/action-gh-release@v2
7089
with:
71-
files: ${{ matrix.artifact_name }}
90+
files: ${{ matrix.asset_name }}
7291
env:
73-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pages.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,35 @@ on:
44
push:
55
branches:
66
- main
7-
# Allows running this workflow manually from the Actions tab
87
workflow_dispatch:
98

10-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
119
permissions:
1210
contents: read
1311
pages: write
1412
id-token: write
1513

16-
# Allow only one concurrent deployment
1714
concurrency:
1815
group: "pages"
1916
cancel-in-progress: true
2017

2118
jobs:
22-
# Build job
2319
build:
2420
runs-on: ubuntu-latest
2521
steps:
2622
- name: Checkout
27-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2824
- name: Setup Pages
29-
uses: actions/configure-pages@v3
25+
uses: actions/configure-pages@v5
3026
- name: Build with Jekyll
3127
uses: actions/jekyll-build-pages@v1
3228
with:
3329
source: ./docs
3430
destination: ./_site
35-
- name: Debug Build Output
36-
run: ls -la ./_site
3731
- name: Upload artifact
38-
uses: actions/upload-artifact@v3.1.2
32+
uses: actions/upload-pages-artifact@v3
3933
with:
40-
name: pages-artifact
4134
path: ./_site
4235

43-
# Deployment job
4436
deploy:
4537
environment:
4638
name: github-pages
@@ -50,4 +42,4 @@ jobs:
5042
steps:
5143
- name: Deploy to GitHub Pages
5244
id: deployment
53-
uses: actions/deploy-pages@v2
45+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)