Skip to content

Commit

Permalink
ci: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Larvan2 committed Jan 15, 2024
1 parent c7bdde6 commit c3360df
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- master
tags:
- "v*"

jobs:
build:
Expand All @@ -17,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true

- name: Cross Compile
Expand All @@ -31,6 +33,27 @@ jobs:
GOOS=windows GOARCH=amd64 go build -o ./bin/geo-windows-amd64.exe ./cmd/geo
GOOS=windows GOARCH=arm64 go build -o ./bin/geo-windows-arm64.exe ./cmd/geo
- uses: actions/upload-artifact@v3
if: ${{ success() }}
with:
name: artifact
path: bin/

Upload-Prerelease:
permissions: write-all
if: ${{ github.ref_type == 'branch' && !startsWith(github.event_name, 'pull_request') }}
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: bin/

- name: Display structure of downloaded files
run: ls -R
working-directory: bin

- name: Delete current release assets
uses: 8Mi-Tech/delete-release-assets-action@main
with:
Expand Down Expand Up @@ -59,3 +82,26 @@ jobs:
bin/*
prerelease: true
generate_release_notes: true

Upload-Release:
permissions: write-all
if: ${{ github.ref_type=='tag' }}
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: bin/

- name: Display structure of downloaded files
run: ls -R
working-directory: bin

- name: Upload Release
uses: softprops/action-gh-release@v1
if: ${{ success() }}
with:
tag_name: ${{ github.ref_name }}
files: bin/*
generate_release_notes: true

0 comments on commit c3360df

Please sign in to comment.