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