From a553514cd9270ae90b27dffb7481cd459905d787 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Tue, 12 Dec 2023 00:28:52 +0100 Subject: [PATCH 1/2] CI: automatically create release, upload windows builds --- .github/workflows/release_by_tag.yml | 66 ++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/release_by_tag.yml diff --git a/.github/workflows/release_by_tag.yml b/.github/workflows/release_by_tag.yml new file mode 100644 index 0000000000..75b695eda4 --- /dev/null +++ b/.github/workflows/release_by_tag.yml @@ -0,0 +1,66 @@ + +on: + push: + tags: [ "v*" ] + +permissions: write-all + +jobs: + release: + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + build-windows: + needs: release + strategy: + matrix: + arch: [ Win32, x64, ARM64 ] + runs-on: windows-2022 + name: windows - ${{ matrix.arch }} + steps: + - uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + autoconf + automake + diffutils + libtool + gcc + git + patch + perl + - uses: actions/checkout@main + - shell: msys2 {0} + run: ./autogen.sh + - shell: cmd + run: cmake -Bbuild -G "Visual Studio 17 2022" -A ${{ matrix.arch }} -DCMAKE_INSTALL_PREFIX=local + - shell: cmd + run: cmake --build build --config Release + - shell: cmd + run: cmake --install build --config Release + - shell: pwsh + run: | + Compress-Archive -Path local\* local.zip + + - name: upload release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.release.outputs.upload_url }} + asset_path: local.zip + asset_name: windows-${{ matrix.arch }}-${{ github.ref }} + asset_content_type: application/zip + From bb6a55be82ba2f42c38e24888873b7c988a466bc Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Tue, 12 Dec 2023 08:17:48 +0100 Subject: [PATCH 2/2] Update .github/workflows/release_by_tag.yml Co-authored-by: Joshua Sing --- .github/workflows/release_by_tag.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_by_tag.yml b/.github/workflows/release_by_tag.yml index 75b695eda4..14072ce070 100644 --- a/.github/workflows/release_by_tag.yml +++ b/.github/workflows/release_by_tag.yml @@ -3,7 +3,8 @@ on: push: tags: [ "v*" ] -permissions: write-all +permissions: + contents: write jobs: release: