From 67b260b6f7a57e933f3d53a1edb3b47a50628ae3 Mon Sep 17 00:00:00 2001 From: Moritz Schmidt Date: Mon, 25 May 2020 10:09:34 +0200 Subject: [PATCH] add release job, consolidate jobs --- .github/workflows/compile.yml | 44 +++++++++++++++++++ .github/workflows/linux-86.yml | 24 ----------- .github/workflows/release.yml | 78 ++++++++++++++++++++++++++++++++++ .github/workflows/win-all.yml | 29 ------------- 4 files changed, 122 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/compile.yml delete mode 100644 .github/workflows/linux-86.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/win-all.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..e23709b --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,44 @@ +name: compile + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + linux: + runs-on: ubuntu-latest + steps: + - name: update apt index + run: sudo apt-get update + - name: 32bit libs + run: sudo apt-get install gcc-multilib g++-multilib + - uses: actions/checkout@v2 + - name: make + run: make + - name: Upload build artifact x86 + uses: actions/upload-artifact@v2 + with: + name: arma3-reflection.so + path: reflection.so + windows: + runs-on: windows-latest + steps: + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1 + - uses: actions/checkout@v2 + - name: Build solution Win32 + run: msbuild /p:Configuration=Release /p:Platform=Win32 + - name: Build solution x64 + run: msbuild /p:Configuration=Release /p:Platform=x64 + - name: Upload build artifact Win32 + uses: actions/upload-artifact@v2 + with: + name: reflection.dll + path: D:\a\arma3-reflection\arma3-reflection\Release\arma3-reflection.dll + - name: Upload build artifact x64 + uses: actions/upload-artifact@v2 + with: + name: reflection_x64.dll + path: D:\a\arma3-reflection\arma3-reflection\x64\Release\arma3-reflection.dll diff --git a/.github/workflows/linux-86.yml b/.github/workflows/linux-86.yml deleted file mode 100644 index 53e1da7..0000000 --- a/.github/workflows/linux-86.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Linux x86 build - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: update apt index - run: sudo apt-get update - - name: 32bit libs - run: sudo apt-get install gcc-multilib g++-multilib - - uses: actions/checkout@v2 - - name: make - run: make - - name: Upload build artifact x86 - uses: actions/upload-artifact@v2 - with: - name: arma3-reflection.so - path: reflection.so diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..688a078 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,78 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: create release + +jobs: + create_release: + name: create github release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Version ${{ github.ref }} + draft: false + prerelease: false + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + build-win: + name: build & upload Windows binaries + runs-on: windows-latest + needs: ["create_release"] + steps: + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1 + - uses: actions/checkout@v2 + - name: Build Win32 + run: msbuild /p:Configuration=Release /p:Platform=Win32 + - name: Upload Win32 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create_release.outputs.upload_url }} + asset_path: .\arma3-reflection\Release\arma3-reflection.dll + asset_name: reflection.dll + asset_content_type: application/octet-stream + - name: Build x64 + run: msbuild /p:Configuration=Release /p:Platform=x64 + - name: Upload Win64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create_release.outputs.upload_url }} + asset_path: .\arma3-reflection\x64\Release\arma3-reflection.dll + asset_name: reflection_x64.dll + asset_content_type: application/octet-stream + build-linux: + runs-on: ubuntu-latest + name: build & upload Linux binary + needs: ["create_release"] + steps: + - name: update apt index + run: sudo apt-get update + - name: 32bit libs + run: sudo apt-get install gcc-multilib g++-multilib + - uses: actions/checkout@v2 + - name: make + run: make + - name: Upload library + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./reflection.so + asset_name: reflection.so + asset_content_type: application/octet-stream diff --git a/.github/workflows/win-all.yml b/.github/workflows/win-all.yml deleted file mode 100644 index 449a617..0000000 --- a/.github/workflows/win-all.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Windows win32/x64 builds - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: windows-latest - steps: - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1 - - uses: actions/checkout@v2 - - name: Build solution Win32 - run: msbuild /p:Configuration=Release /p:Platform=Win32 - - name: Build solution x64 - run: msbuild /p:Configuration=Release /p:Platform=x64 - - name: Upload build artifact Win32 - uses: actions/upload-artifact@v2 - with: - name: reflection.dll - path: D:\a\arma3-reflection\arma3-reflection\Release\arma3-reflection.dll - - name: Upload build artifact x64 - uses: actions/upload-artifact@v2 - with: - name: reflection_x64.dll - path: D:\a\arma3-reflection\arma3-reflection\x64\Release\arma3-reflection.dll