diff --git a/.github/workflows/release_by_tag.yml b/.github/workflows/release_by_tag.yml new file mode 100644 index 0000000000..14072ce070 --- /dev/null +++ b/.github/workflows/release_by_tag.yml @@ -0,0 +1,67 @@ + +on: + push: + tags: [ "v*" ] + +permissions: + contents: write + +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 +