diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..475ae52 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Build and Release Linodsync Binary + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + build: + name: Build Static Linux Binary + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.20 + + - name: Build static binary for Linux amd64 + run: | + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o linodsync + mkdir -p build + mv linodsync build/ + + release: + name: Create GitHub Release + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Upload release assets + uses: softprops/action-gh-release@v1 + with: + files: build/linodsync + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}