diff --git a/.github/workflows/release-wattpad.yml b/.github/workflows/release-wattpad.yml new file mode 100644 index 0000000000..00312c0d0a --- /dev/null +++ b/.github/workflows/release-wattpad.yml @@ -0,0 +1,49 @@ +name: Build and Release + +on: + release: + types: [ published ] + +jobs: + build: + name: Build and Release + runs-on: ubuntu-latest + + strategy: + matrix: + go_os: [ linux, darwin, windows ] + go_arch: [ amd64, arm64 ] + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22.x + + # Build the go-task binary from the current repository + - name: Build go-task for ${{ matrix.go_os }}-${{ matrix.go_arch }} + run: | + GOOS=${{ matrix.go_os }} \ + GOARCH=${{ matrix.go_arch }} \ + CGO_ENABLED=0 \ + go build \ + -o task \ + ./cmd/task + + # Compress the go-task binary + - name: Compress go-task for ${{ matrix.go_os }}-${{ matrix.go_arch }} + run: | + tar -cvzf task_${{ matrix.go_os }}_${{ matrix.go_arch }}.tar.gz \ + task \ + README.md \ + LICENSE \ + completion/ + + - name: Upload Release Asset + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload ${{ github.event.release.tag_name }} ./task_${{ matrix.go_os }}_${{ matrix.go_arch }}.tar.gz