Skip to content

Commit

Permalink
On file not found, show the error and try to auto release
Browse files Browse the repository at this point in the history
  • Loading branch information
QuintenQVD0 authored Feb 3, 2024
1 parent 806bf52 commit 764afe9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,28 @@ jobs:
if: matrix.goos == 'windows'
with:
name: PalworldServerConfigParser-${{ matrix.goos }}-${{ matrix.goarch }}.exe
path: dist/PalworldServerConfigParser-${{ matrix.goos }}-${{ matrix.goarch }}.exe
path: dist/PalworldServerConfigParser-${{ matrix.goos }}-${{ matrix.goarch }}.exe

release:
name: Create Release
runs-on: ubuntu-20.04

if: startsWith(github.event.head_commit.message, 'Release:')

steps:
uses: actions/checkout@v4

- name: Extract tag from commit message
id: extract_tag
run: echo "::set-output name=tag::$(echo ${{ github.event.head_commit.message }} | grep -oP 'Release: \K(.*)')"

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files:
- 'dist/PalworldServerConfigParser-linux-amd64'
- 'dist/PalworldServerConfigParser-linux-arm64'
- 'dist/PalworldServerConfigParser-windows-amd64.exe'
- 'dist/PalworldServerConfigParser-windows-arm64.exe'
tag_name: v${{ steps.extract_tag.outputs.tag }}
title: ${{ steps.extract_tag.outputs.tag }}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func main() {

// Check if the INI file exists
if _, err := os.Stat(iniFilePath); os.IsNotExist(err) {
fmt.Printf("INI file not found, Exiting")
fmt.Printf("Error: INI file not found. Exiting. %v\n", err)
return
}

Expand Down

0 comments on commit 764afe9

Please sign in to comment.