diff options
author | Felix Kröner <felix.kroener@gmx.de> | 2024-11-07 08:30:12 +0100 |
---|---|---|
committer | earl-warren <earl-warren@noreply.code.forgejo.org> | 2024-11-07 08:30:12 +0100 |
commit | 228e0025657576ad666b4a2756b1e3f26743661c (patch) | |
tree | be53ff6e9a0d426e40600417ad9eaf78445a968e | |
parent | Merge pull request 'Update dependency go to v1.23.3' (#313) from renovate/pat... (diff) | |
download | forgejo-runner-228e0025657576ad666b4a2756b1e3f26743661c.tar.xz forgejo-runner-228e0025657576ad666b4a2756b1e3f26743661c.zip |
Add support for windows build on GitHub (#312)
This PR adds a Windows build pipeline running on GitHub.
Currently it runs on the repository https://github.com/Crown0815/forgejo-runner-windows.
So far the build does not include tests, but I am working on a solution.
For the time being we can release the windows builds easily though.
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/312
Co-authored-by: Felix Kröner <felix.kroener@gmx.de>
Co-committed-by: Felix Kröner <felix.kroener@gmx.de>
-rw-r--r-- | .github/workflows/build-release.yml | 48 | ||||
-rw-r--r-- | .gitignore | 3 |
2 files changed, 51 insertions, 0 deletions
diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..8086590 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,48 @@ +# This workflow will build a Windows binary for each architecture and upload it as an artifact. +# If the push is a tag, it will create a release with the binaries attached. +# This build is currently supported on https://github.com/Crown0815/forgejo-runner-windows + +name: Build release + +on: + push: + tags: 'v*' +jobs: + build: + name: Build ${{matrix.architecture}} + runs-on: ubuntu-latest + strategy: + matrix: + architecture: ['386', amd64, arm, arm64] + steps: + - uses: actions/checkout@v4 + - name: Build for ${{matrix.architecture}} + run: | + env GOOS=windows GOARCH=${{matrix.architecture}} \ + go build -o forgejo-runner-windows-${{matrix.architecture}}.exe + + - uses: actions/upload-artifact@v4 + with: + name: forgejo-runner-windows-${{matrix.architecture}} + path: forgejo-runner-windows-${{matrix.architecture}}.exe + + release: + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'push' && github.ref_type == 'tag' + steps: + - uses: actions/download-artifact@v4 + with: + path: . + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + files: forgejo-runner-windows-*/forgejo-runner-windows-*.exe + draft: false + prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} + token: ${{ secrets.RELEASE_TOKEN }} + fail_on_unmatched_files: true + body: See [original release notes](https://code.forgejo.org/forgejo/runner/releases/tag/${{ github.ref_name }}). + @@ -12,3 +12,6 @@ coverage.txt __debug_bin # gorelease binary folder dist + +# Jetbrains IDE +.idea |