Skip to content

Commit e52eeea

Browse files
authored
Migrate to the just build system and add automated release tooling (#429)
* Create justfile with documentation on how to use it * Add GitHub action to automatically make a release on tag push
1 parent 74ac92b commit e52eeea

File tree

13 files changed

+146
-113
lines changed

13 files changed

+146
-113
lines changed

‎.github/workflows/coverage.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ jobs:
1616
go-version: 1.21
1717
- name: Checkout code
1818
uses: actions/checkout@v2
19+
- name: Set up Just
20+
uses: extractions/setup-just@v1
1921
- name: Generate coverage report
20-
run: go test -v -coverprofile=profile.cov ./...
22+
run: just coverage
2123
- name: Parse overall coverage
2224
run: coverage=$(go tool cover -func profile.cov | tail -1 | rev | cut -f 1 | rev) && echo "COVERAGE=$coverage" >> $GITHUB_ENV
2325
- name: Create the Badge
@@ -28,4 +30,4 @@ jobs:
2830
filename: coverage.json
2931
label: Coverage
3032
message: ${{ env.COVERAGE }}
31-
color: green
33+
color: green

‎.github/workflows/golangci-lint.yml‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎.github/workflows/help_wanted_notify.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: notify social media (help wanted)
1+
name: Notify Discord about "help wanted" issues
22

33
on:
44
issues:

‎.github/workflows/lint.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- main
9+
pull_request:
10+
jobs:
11+
golangci:
12+
name: lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Run golangci-lint
17+
uses: golangci/golangci-lint-action@v2.5.2
18+
with:
19+
version: latest
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Nightly Release
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *' # Run at 0800 UTC (0300 EST) every day
6+
7+
jobs:
8+
mwe:
9+
runs-on: ubuntu-latest
10+
steps:
11+
12+
# Clone repository
13+
- uses: actions/checkout@v2
14+
15+
# Update tag and pre-release
16+
# - Update (force-push) tag to the commit that is used in the workflow.
17+
# - Upload artifacts defined by the user.
18+
- uses: pyTooling/Actions/releaser@r0
19+
with:
20+
tag: nightly
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
files: ./*

‎.github/workflows/push_notify.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: notify social media
1+
name: Notify Discord
22

33
on:
44
release:

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
name: goreleaser
1+
name: Release
22

33
on:
44
push:
55
tags:
6-
- v*.*.*
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
77

88
jobs:
9-
goreleaser:
9+
build:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
1113
steps:
12-
-
13-
name: Checkout
14-
uses: actions/checkout@v2
15-
with:
16-
fetch-depth: 0
17-
-
18-
name: Set up Go
19-
uses: actions/setup-go@v2
20-
with:
21-
go-version: 1.21
22-
-
23-
name: Run GoReleaser
24-
uses: goreleaser/goreleaser-action@v2
25-
with:
26-
version: latest
27-
args: release --rm-dist
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.HOMEBREW_DEPLOY_SECRET }}
14+
- uses: actions/checkout@v3
15+
- name: Get changelog
16+
run: |
17+
TAG=${{github.ref_name}}
18+
VERSION=${TAG#v}
19+
{
20+
echo "RELEASE_BODY<<EOF"
21+
echo "# [$VERSION] - $(date +%Y-%m-%d)"
22+
echo "$(awk '/## \['$VERSION']/{flag=1; next} /## \[/{flag=0} flag' CHANGELOG.md)"
23+
echo EOF
24+
} >> "$GITHUB_ENV"
25+
- uses: ncipollo/release-action@v1
26+
with:
27+
makeLatest: true
28+
prerelease: true
29+
body: ${{env.RELEASE_BODY}}

‎.github/workflows/take.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
with:
1616
message: Thanks for taking this issue! Let us know if you have any questions!
1717
trigger: .take
18-
token: ${{ secrets.GITHUB_TOKEN }}
18+
token: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/test.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
name: Test
2+
13
on:
24
push:
35
tags:
46
- v*
57
branches:
68
- main
79
pull_request:
8-
name: Test
10+
911
jobs:
1012
test:
1113
strategy:
@@ -20,5 +22,7 @@ jobs:
2022
go-version: ${{ matrix.go-version }}
2123
- name: Checkout code
2224
uses: actions/checkout@v2
23-
- name: Test
24-
run: go test -v ./...
25+
- name: Set up Just
26+
uses: extractions/setup-just@v1
27+
- name: Run tests
28+
run: just test

‎.goreleaser.yml‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)