diff options
-rw-r--r-- | .github/workflows/release_by_tag.yml | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/.github/workflows/release_by_tag.yml b/.github/workflows/release_by_tag.yml new file mode 100644 index 0000000..14072ce --- /dev/null +++ b/.github/workflows/release_by_tag.yml | |||
@@ -0,0 +1,67 @@ | |||
1 | |||
2 | on: | ||
3 | push: | ||
4 | tags: [ "v*" ] | ||
5 | |||
6 | permissions: | ||
7 | contents: write | ||
8 | |||
9 | jobs: | ||
10 | release: | ||
11 | runs-on: ubuntu-latest | ||
12 | outputs: | ||
13 | upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
14 | steps: | ||
15 | - id: create_release | ||
16 | uses: actions/create-release@v1 | ||
17 | env: | ||
18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
19 | with: | ||
20 | tag_name: ${{ github.ref }} | ||
21 | release_name: Release ${{ github.ref }} | ||
22 | draft: false | ||
23 | prerelease: false | ||
24 | |||
25 | build-windows: | ||
26 | needs: release | ||
27 | strategy: | ||
28 | matrix: | ||
29 | arch: [ Win32, x64, ARM64 ] | ||
30 | runs-on: windows-2022 | ||
31 | name: windows - ${{ matrix.arch }} | ||
32 | steps: | ||
33 | - uses: msys2/setup-msys2@v2 | ||
34 | with: | ||
35 | update: true | ||
36 | install: >- | ||
37 | autoconf | ||
38 | automake | ||
39 | diffutils | ||
40 | libtool | ||
41 | gcc | ||
42 | git | ||
43 | patch | ||
44 | perl | ||
45 | - uses: actions/checkout@main | ||
46 | - shell: msys2 {0} | ||
47 | run: ./autogen.sh | ||
48 | - shell: cmd | ||
49 | run: cmake -Bbuild -G "Visual Studio 17 2022" -A ${{ matrix.arch }} -DCMAKE_INSTALL_PREFIX=local | ||
50 | - shell: cmd | ||
51 | run: cmake --build build --config Release | ||
52 | - shell: cmd | ||
53 | run: cmake --install build --config Release | ||
54 | - shell: pwsh | ||
55 | run: | | ||
56 | Compress-Archive -Path local\* local.zip | ||
57 | |||
58 | - name: upload release | ||
59 | uses: actions/upload-release-asset@v1 | ||
60 | env: | ||
61 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
62 | with: | ||
63 | upload_url: ${{ needs.release.outputs.upload_url }} | ||
64 | asset_path: local.zip | ||
65 | asset_name: windows-${{ matrix.arch }}-${{ github.ref }} | ||
66 | asset_content_type: application/zip | ||
67 | |||