diff options
author | Joshua Sing <joshua@hypera.dev> | 2023-12-15 16:36:25 +1100 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2024-03-03 15:32:50 -0600 |
commit | c3fc668dc44e06ef44c57635b81e9502f44a6465 (patch) | |
tree | d41f894c40d1b1add3f55dffca049caa9353e355 /.github/workflows | |
parent | d8ade653138714ecc097b8e24d8c17e82d11c45b (diff) | |
download | portable-c3fc668dc44e06ef44c57635b81e9502f44a6465.tar.gz portable-c3fc668dc44e06ef44c57635b81e9502f44a6465.tar.bz2 portable-c3fc668dc44e06ef44c57635b81e9502f44a6465.zip |
ci: clean up release workflow
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/release.yml | 81 | ||||
-rw-r--r-- | .github/workflows/release_by_tag.yml | 66 |
2 files changed, 81 insertions, 66 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8230b82 --- /dev/null +++ b/.github/workflows/release.yml | |||
@@ -0,0 +1,81 @@ | |||
1 | # GitHub Actions workflow to create releases from tags. | ||
2 | name: "Release" | ||
3 | |||
4 | on: | ||
5 | push: | ||
6 | tags: [ "v*" ] | ||
7 | |||
8 | permissions: | ||
9 | contents: write | ||
10 | |||
11 | jobs: | ||
12 | release: | ||
13 | name: "Release" | ||
14 | runs-on: "ubuntu-latest" | ||
15 | outputs: | ||
16 | upload_url: "${{ steps.create_release.outputs.upload_url }}" | ||
17 | steps: | ||
18 | - name: "Checkout repository" | ||
19 | uses: actions/checkout@v4 | ||
20 | |||
21 | - name: "Generate version changelog" | ||
22 | run: .github/scripts/changelog.sh "$VERSION" > release-changelog.txt | ||
23 | env: | ||
24 | VERSION: "${{ github.ref_name }}" | ||
25 | |||
26 | - name: "Create GitHub release" | ||
27 | id: create_release | ||
28 | uses: softprops/action-gh-release@v1 | ||
29 | with: | ||
30 | body_path: "${{ github.workspace }}/release-changelog.txt" | ||
31 | |||
32 | build-windows: | ||
33 | name: "${{ matrix.os }}/${{ matrix.arch }}" | ||
34 | runs-on: "${{ matrix.os }}" | ||
35 | needs: ["release"] | ||
36 | strategy: | ||
37 | matrix: | ||
38 | os: [ "windows-2022" ] | ||
39 | arch: [ "Win32", "x64", "ARM64" ] | ||
40 | steps: | ||
41 | - name: "Checkout repository" | ||
42 | uses: actions/checkout@v4 | ||
43 | |||
44 | - name: "Setup MSYS2" | ||
45 | uses: msys2/setup-msys2@v2 | ||
46 | with: | ||
47 | update: true | ||
48 | install: >- | ||
49 | autoconf | ||
50 | automake | ||
51 | diffutils | ||
52 | libtool | ||
53 | gcc | ||
54 | git | ||
55 | patch | ||
56 | perl | ||
57 | |||
58 | - shell: msys2 {0} | ||
59 | run: ./autogen.sh | ||
60 | |||
61 | - shell: cmd | ||
62 | run: cmake -Bbuild -G "Visual Studio 17 2022" -A ${{ matrix.arch }} -DCMAKE_INSTALL_PREFIX=local | ||
63 | |||
64 | - shell: cmd | ||
65 | run: cmake --build build --config Release | ||
66 | |||
67 | - shell: cmd | ||
68 | run: cmake --install build --config Release | ||
69 | |||
70 | - shell: pwsh | ||
71 | run: Compress-Archive -Path local\* local.zip | ||
72 | |||
73 | - name: "Upload release artifact" | ||
74 | uses: actions/upload-release-asset@v1 | ||
75 | env: | ||
76 | GITHUB_TOKEN: "${{ github.token }}" | ||
77 | with: | ||
78 | upload_url: "${{ needs.release.outputs.upload_url }}" | ||
79 | asset_path: "local.zip" | ||
80 | asset_name: "libressl_${{ github.ref_name }}_windows_${{ matrix.arch }}.zip" | ||
81 | asset_content_type: "application/zip" | ||
diff --git a/.github/workflows/release_by_tag.yml b/.github/workflows/release_by_tag.yml deleted file mode 100644 index de05254..0000000 --- a/.github/workflows/release_by_tag.yml +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
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 }}.zip | ||
66 | asset_content_type: application/zip | ||