-
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.
this change adds conventional commit version updates
- Loading branch information
1 parent
3fe14ed
commit 35c0bd4
Showing
2 changed files
with
42 additions
and
18 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 |
---|---|---|
@@ -1,19 +1,34 @@ | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
branches: [main] | ||
paths: | ||
- "versionHelper.go" | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
|
||
build: | ||
outputs: | ||
next: ${{ steps.get-version.outputs.next }} | ||
bump: ${{ steps.get-version.outputs.bump }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
|
||
|
||
- name: Get Next version | ||
id: get-version | ||
uses: ietf-tools/[email protected] | ||
with: | ||
token: ${{ github.token }} | ||
branch: ${{ github.ref }} | ||
noVersionBumpBehavior: 'current' | ||
|
||
- name: debug | ||
run: | | ||
echo ${{ steps.get-version.outputs.next }} | ||
echo ${{ steps.get-version.outputs.bump }} | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
|
@@ -26,14 +41,16 @@ jobs: | |
- name: ls debug | ||
run: ls -a && pwd | ||
|
||
- name: Update version in main.go | ||
shell: bash | ||
run: | | ||
new_version=${{ steps.get-version.outputs.nextStrict }} | ||
sed -i "s/const version = \"[0-9]*\.[0-9]*\.[0-9]*\"/const version = \"$new_version\"/g" ${{ github.workspace }}/main.go | ||
- name: Build for Windows (amd64) | ||
run: | | ||
env GOOS=windows GOARCH=amd64 go build -o /home/runner/work/wowtools/wowtools/build/wowtools.exe | ||
# Go Tests are acting up due to the W32 module - I've disabled all the tests but it still spits errors out. Disabling for now as these are all local tests anyways | ||
#- name: Test | ||
#run: go test -v ./... | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
|
@@ -44,17 +61,22 @@ jobs: | |
release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: startsWith(github.ref, 'refs/tags/') | ||
if: ${{ needs.build.outputs.bump != '' && github.ref == 'refs/heads/main' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download Windows Artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: WoWTools-AMD64 | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
- uses: actions/checkout@v4 | ||
with: | ||
files: | | ||
wowtools.exe | ||
fetch-depth: 0 | ||
|
||
- name: Create Release | ||
shell: bash | ||
run: > | ||
gh release create ${{ needs.build.outputs.next }} | ||
wowtools.exe | ||
--title ${{ needs.build.outputs.next }} | ||
--generate-notes --notes-start-tags | ||
${{ needs.build.outputs.next }} |
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