Merge pull request #3 from DBHeise/20250526_workflows #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: OnMain | ||
| on: | ||
| push: | ||
| branches: [master] | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: "${{ github.ref }}-${{ github.workflow }}" | ||
| cancel-in-progress: true | ||
| jobs: | ||
| build-linux: | ||
| name: Linux Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| with: | ||
| submodules: true | ||
| - name: Build | ||
| run: | | ||
| mkdir -p bin/linux | ||
| make clean | ||
| make | ||
| - name: Archive | ||
| uses: actions/upload-artifact@v1 | ||
| with: | ||
| name: Linux-binaries.zip | ||
| path: bin/linux | ||
| build-windows: | ||
| name: Windows Build | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| with: | ||
| submodules: true | ||
| - name: Build | ||
| run: | | ||
| ./build.ps1 | ||
| - name: Archive x86 | ||
| uses: actions/upload-artifact@v1 | ||
| with: | ||
| name: Windows-x86-binaries.zip | ||
| path: bin/windows/x86/Release | ||
| - name: Archive x64 | ||
| uses: actions/upload-artifact@v1 | ||
| with: | ||
| name: Windows-x64-binaries.zip | ||
| path: bin/windows/x64/Release | ||
| version: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - build-linux | ||
| - build-windows | ||
| permissions: | ||
| contents: write | ||
| outputs: | ||
| newtag: ${{ steps.calculate-version.outputs.version-string }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
| - name: calculate version | ||
| id: calculate-version | ||
| uses: bitshifted/git-auto-semver@v1 | ||
| with: | ||
| main_branch: master | ||
| create_tag: true | ||
| tag_prefix: 'v' | ||
| - name: Use version | ||
| run: 'echo "Calculated version: ${{ steps.calculate-version.outputs.version-string }}"' | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| needs: version | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-tags: true | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
| pattern: *binaries.zip | ||
| merge-multiple: true | ||
| - name: Create a Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| name: ${{ needs.version.outputs.newtag }} | ||
| tag_name: ${{ needs.version.outputs.newtag }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| make_latest: true | ||
| files: | ||
| artifacts/*binaries.zip | ||