Skip to content

Commit

Permalink
feat: add Windows builds and compressed releases
Browse files Browse the repository at this point in the history
  • Loading branch information
johnonline35 committed Nov 8, 2024
1 parent c805cd4 commit 2825390
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags: ["v*"]
branches: ["main"]

permissions:
contents: write
packages: write

jobs:
docker:
runs-on: ubuntu-latest
Expand All @@ -21,7 +25,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
push: ${{ startsWith(github.ref, 'refs/tags/') }} # Only push on tags
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}
Expand All @@ -37,15 +41,27 @@ jobs:

- name: Build binaries
run: |
# Build for each platform
GOOS=linux GOARCH=amd64 go build -o pg-archiver-linux-amd64
GOOS=darwin GOARCH=amd64 go build -o pg-archiver-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -o pg-archiver-darwin-arm64
GOOS=windows GOARCH=amd64 go build -o pg-archiver-windows-amd64.exe
# Set execute permissions
chmod +x pg-archiver-*
# Create compressed archives
tar czf pg-archiver-linux-amd64.tar.gz pg-archiver-linux-amd64
tar czf pg-archiver-darwin-amd64.tar.gz pg-archiver-darwin-amd64
tar czf pg-archiver-darwin-arm64.tar.gz pg-archiver-darwin-arm64
zip pg-archiver-windows-amd64.zip pg-archiver-windows-amd64.exe
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
pg-archiver-linux-amd64
pg-archiver-darwin-amd64
pg-archiver-darwin-arm64
pg-archiver-linux-amd64.tar.gz
pg-archiver-darwin-amd64.tar.gz
pg-archiver-darwin-arm64.tar.gz
pg-archiver-windows-amd64.zip

0 comments on commit 2825390

Please sign in to comment.