-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
13 changed files
with
146 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: notify social media (help wanted) | ||
name: Notify Discord about "help wanted" issues | ||
|
||
on: | ||
issues: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Nightly Release | ||
|
||
on: | ||
schedule: | ||
- cron: '0 8 * * *' # Run at 0800 UTC (0300 EST) every day | ||
|
||
jobs: | ||
mwe: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Clone repository | ||
- uses: actions/checkout@v2 | ||
|
||
# Update tag and pre-release | ||
# - Update (force-push) tag to the commit that is used in the workflow. | ||
# - Upload artifacts defined by the user. | ||
- uses: pyTooling/Actions/releaser@r0 | ||
with: | ||
tag: nightly | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
files: ./* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: notify social media | ||
name: Notify Discord | ||
|
||
on: | ||
release: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
name: goreleaser | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v*.*.* | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
goreleaser: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.21 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.HOMEBREW_DEPLOY_SECRET }} | ||
- uses: actions/checkout@v3 | ||
- name: Get changelog | ||
run: | | ||
TAG=${{github.ref_name}} | ||
VERSION=${TAG#v} | ||
{ | ||
echo "RELEASE_BODY<<EOF" | ||
echo "# [$VERSION] - $(date +%Y-%m-%d)" | ||
echo "$(awk '/## \['$VERSION']/{flag=1; next} /## \[/{flag=0} flag' CHANGELOG.md)" | ||
echo EOF | ||
} >> "$GITHUB_ENV" | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
makeLatest: true | ||
prerelease: true | ||
body: ${{env.RELEASE_BODY}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env just --justfile | ||
|
||
# List available recipes | ||
default: | ||
@just --list | ||
|
||
# Get coverage profile | ||
coverage: | ||
go test -v -coverprofile=provile.cov ./... | ||
|
||
# Linting and static checks | ||
lint: | ||
golangci-lint -c .golangci.yml run | ||
|
||
# Run tests | ||
test: | ||
go test -v ./... | ||
|
||
branch := `git branch --show-current` | ||
|
||
# Bump version in changelog and create commit + tag on current branch | ||
cut-release $NEW_VERSION: | ||
just lint | ||
just test | ||
sed -i "s/## \[Unreleased]\s*\n*/## [Unreleased]\n\n## [$NEW_VERSION] $(date +'%Y-%m-%d')/g" CHANGELOG.md | ||
echo "[$NEW_VERSION]: https://github.com/bebop/poly/releases/tag/v$NEW_VERSION" >> CHANGELOG.md | ||
git add CHANGELOG.md | ||
git commit -m "Release version v$NEW_VERSION" | ||
git tag v$NEW_VERSION |