-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
branches: | ||
- main | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
fetchGitHubIssue: | ||
|
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,69 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'The version of the release' | ||
required: true | ||
|
||
jobs: | ||
tests: | ||
uses: ./.github/workflows/integration_tests.yml | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
needs: [tests] | ||
steps: | ||
- name: Validate version | ||
run: | | ||
SEMVER_REGEX_WITH_LEADING_V="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" | ||
if [[ ! "${{ github.event.inputs.version }}" =~ $SEMVER_REGEX_WITH_LEADING_V ]]; then | ||
echo "Invalid version format. Please use a valid semver version, prefixed with 'v'." | ||
exit 1 | ||
fi | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Build for MacOS | ||
run: | | ||
GOOS=darwin GOARCH=amd64 go build -o summaraizer-macos-amd64 cmd/summaraizer/summaraizer.go | ||
GOOS=darwin GOARCH=arm64 go build -o summaraizer-macos-arm64 cmd/summaraizer/summaraizer.go | ||
- name: Build for Linux | ||
run: GOOS=linux GOARCH=amd64 go build -o summaraizer-linux-amd64 cmd/summaraizer/summaraizer.go | ||
|
||
- name: Build for Windows | ||
run: GOOS=windows GOARCH=amd64 go build -o summaraizer-windows-amd64 cmd/summaraizer/summaraizer.go | ||
|
||
- name: Setup git | ||
run: | | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git config user.name "GitHub Actions [Bot]" | ||
- name: Create tag | ||
run: git tag -a -m ${{ github.event.inputs.version }} ${{ github.event.inputs.version }} | ||
|
||
- name: Push tag | ||
run: git push origin ${{ github.event.inputs.version }} | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
summaraizer-macos-amd64 | ||
summaraizer-macos-arm64 | ||
summaraizer-linux-amd64 | ||
summaraizer-windows-amd64 | ||
fail_on_unmatched_files: true | ||
name: ${{ github.event.inputs.version }} | ||
tag_name: ${{ github.event.inputs.version }} | ||
generate_release_notes: true | ||
draft: true | ||
prerelease: true |
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,16 @@ | ||
# Release | ||
|
||
The release process is fully automated via GitHub Actions. | ||
To dispatch a release, go to the Actions tab and select the ["Release" workflow](https://github.com/ioki-mobility/summaraizer/actions/workflows/release.yml). | ||
Click on the "Run workflow" button and fill in the tag name. | ||
The workflow will then do the following: | ||
* Run integration tests | ||
* Build the CLI binaries for Linux (amd64), macOS (amd64, arm64), and Windows (amd64) | ||
* Create a git tag with the specified tag name | ||
* Create a GitHub release and publish it with an automatically generated changelog | ||
|
||
It will create a draft release by default, so you can review the changelog before publishing it. | ||
|
||
## Tag name | ||
|
||
Please follow the [Go module versioning scheme](https://go.dev/doc/modules/version-numbers) for the tag name. |