diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..de0359c --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,79 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Build and release binaries + +on: + push: + tags: + - "v*.*.*-alpha" + +jobs: + build-linux: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + - name: Build + run: go build -o nfs-linux-x86_64 . + - name: Upload Go test results + uses: actions/upload-artifact@v4 + with: + retention-days: 7 + name: nfs-linux-x86_64 + path: ./nfs-linux-x86_64 + build-macos: + if: startsWith(github.ref, 'refs/tags/') + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + - name: Build + run: go build -o nfs-darwin-x86_64 . + - name: Upload Go test results + uses: actions/upload-artifact@v4 + with: + retention-days: 7 + name: nfs-darwin-x86_64 + path: ./nfs-darwin-x86_64 + build-windows: + if: startsWith(github.ref, 'refs/tags/') + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + - name: Build + run: go build -o nfs-windows-x86_64.exe . + - name: Upload Go test results + uses: actions/upload-artifact@v4 + with: + retention-days: 7 + name: nfs-windows-x86_64.exe + path: ./nfs-windows-x86_64.exe + release: + if: startsWith(github.ref, 'refs/tags/') + permissions: + contents: write + needs: + - build-windows + - build-linux + - build-macos + runs-on: ubuntu-latest + steps: + # Downloads all artifacts: + - name: Download a single artifact + uses: actions/download-artifact@v4 + - name: Create github release + uses: ncipollo/release-action@v1 + with: + artifacts: "./*/nfs-*" \ No newline at end of file