Skip to content

Commit c29c26e

Browse files
committed
ci: update ci scripts to generate release for each platform
1 parent 2320234 commit c29c26e

File tree

2 files changed

+81
-58
lines changed

2 files changed

+81
-58
lines changed

.github/workflows/main.yml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,28 @@ jobs:
7575
shell: bash
7676
run: |
7777
mkdir BUILD_RELEASE
78-
cd BUILD_RELEASE
78+
pushd BUILD_RELEASE
7979
cmake -DCMAKE_BUILD_TYPE=Release ..
8080
cmake --build . --parallel $BUILD_JOBS --config Release
81+
mkdir -p release-artifacts
82+
popd
83+
- name: Build release
84+
shell: bash
85+
run: |
86+
pushd BUILD_RELEASE
87+
cmake --install . --prefix ./${{ env.REPO_NAME }}-release
88+
popd
89+
- name: Create zip
90+
shell: bash
91+
run: |
92+
pushd BUILD_RELEASE
93+
zip -r ../${{ env.REPO_NAME }}-release-${{ matrix.platform }}.zip ${{ env.REPO_NAME }}-release/
94+
popd
95+
- name: Upload linux release
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: ${{ env.REPO_NAME }}-release-${{ matrix.platform }}
99+
path: ${{ env.REPO_NAME }}-release-${{ matrix.platform }}.zip
81100

82101
vk_video_samples-win:
83102
strategy:
@@ -146,8 +165,28 @@ jobs:
146165
cmake --build . --parallel $BUILD_JOBS --config Debug
147166
148167
- name: Build Release
168+
shell: bash
149169
run: |
150170
mkdir BUILD_RELEASE
151-
cd BUILD_RELEASE
171+
pushd BUILD_RELEASE
152172
cmake -DCMAKE_GENERATOR_PLATFORM=${{ matrix.cmake_arch }} -DCMAKE_BUILD_TYPE=Release ..
153173
cmake --build . --parallel $BUILD_JOBS --config Release
174+
mkdir release-artifacts
175+
- name: Install Release
176+
shell: bash
177+
run: |
178+
pushd BUILD_RELEASE
179+
cmake --install . --prefix ./${{ env.REPO_NAME }}-release --config Release
180+
popd
181+
182+
- name: Create zip
183+
shell: bash
184+
run: |
185+
pushd BUILD_RELEASE
186+
zip -r ../${{ env.REPO_NAME }}-release-${{ matrix.platform }}.zip ${{ env.REPO_NAME }}-release
187+
popd
188+
- name: Upload windows release
189+
uses: actions/upload-artifact@v4
190+
with:
191+
name: ${{ env.REPO_NAME }}-release-${{ matrix.platform }}
192+
path: ${{ env.REPO_NAME }}-release-${{ matrix.platform }}.zip

.github/workflows/release.yml

Lines changed: 40 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -13,86 +13,70 @@ jobs:
1313
build-release:
1414
name: Build release
1515
uses: ./.github/workflows/main.yml
16-
create-release:
17-
name: Create Release
16+
process-artifacts:
17+
name: Process Release Artifacts
1818
runs-on: ubuntu-latest
1919
needs: build-release
20+
strategy:
21+
matrix:
22+
platform: [linux-x86_64, linux-x86_64-ffmpeg, linux-x86, windows-x64, windows-x64-ffmpeg, win-arm64]
2023
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v2
23-
- name: Archive Linux zip results
24+
- name: Download artifact
2425
uses: actions/download-artifact@v4
25-
env:
26-
PLATFORM: linux-x86_64
2726
with:
28-
name: ${{ env.REPO_NAME }}-release-${{ env.PLATFORM }}
27+
name: ${{ env.REPO_NAME }}-release-${{ matrix.platform }}
2928
path: ./
30-
- name: Create Linux release
31-
env:
32-
PLATFORM: linux-x86_64
29+
- name: Rename artifact
3330
shell: bash
34-
run:
35-
mv $REPO_NAME-release-$PLATFORM.zip $REPO_NAME-${{ github.ref_name }}-$PLATFORM.zip
36-
- name: Upload linux release
37-
env:
38-
PLATFORM: linux-x86_64
31+
run: |
32+
mv ${{ env.REPO_NAME }}-release-${{ matrix.platform }}.zip ${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ matrix.platform }}.zip
33+
- name: Upload renamed artifact
3934
uses: actions/upload-artifact@v4
4035
with:
41-
name: ${{ env.REPO_NAME }}-${{ env.ref_name }}-${{ github.PLATFORM }}
42-
path: ${{ env.REPO_NAME }}-${{ env.ref_name }}-{{ github.PLATFORM }}.zip
43-
44-
- name: Archive Windows zip results
45-
uses: actions/download-artifact@v4
46-
env:
47-
PLATFORM: windows-x64
48-
with:
49-
name: ${{ env.REPO_NAME }}-release-${{ env.PLATFORM }}
50-
path: ./
51-
- name: Create Windows release
52-
env:
53-
PLATFORM: windows-x64
54-
shell: bash
55-
run:
56-
mv $REPO_NAME-release-$PLATFORM.zip $REPO_NAME-${{ github.ref_name }}-$PLATFORM.zip
57-
- name: Upload Windows release
58-
uses: actions/upload-artifact@v4
59-
env:
60-
PLATFORM: windows-x64
61-
with:
62-
name: ${{ env.REPO_NAME }}-${{ env.ref_name }}-${{ github.PLATFORM }}
63-
path: ${{ env.REPO_NAME }}-${{ env.ref_name }}-{{ github.PLATFORM }}.zip
36+
name: ${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ matrix.platform }}
37+
path: ${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ matrix.platform }}.zip
6438

39+
create-release:
40+
name: Create Release
41+
runs-on: ubuntu-latest
42+
needs: process-artifacts
43+
outputs:
44+
upload_url: ${{ steps.create_release.outputs.upload_url }}
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v2
6548
- name: Create Release
6649
id: create_release
6750
uses: actions/create-release@v1
6851
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7053
with:
7154
tag_name: release-${{ github.ref_name }}
7255
release_name: ${{ env.PRETTY_NAME }} ${{ github.ref_name }}
7356
body: |
7457
${{ env.PRETTY_NAME }}-${{ github.ref_name }} has been released. You can find details [here](https://github.com/dabrain34/${{ env.PRETTY_NAME }}/blob/main/Changelog.md)
7558
draft: false
7659
prerelease: false
77-
- name: Upload Linux Release Asset
78-
id: upload-linux-x86_64-release-asset
79-
uses: actions/upload-release-asset@v1
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
PLATFORM: linux-x86_64
60+
61+
upload-assets:
62+
name: Upload Release Assets
63+
runs-on: ubuntu-latest
64+
needs: create-release
65+
strategy:
66+
matrix:
67+
platform: [linux-x86_64, linux-x86_64-ffmpeg, linux-x86, windows-x64, windows-x64-ffmpeg, win-arm64]
68+
steps:
69+
- name: Download artifact
70+
uses: actions/download-artifact@v4
8371
with:
84-
upload_url: ${{ steps.create_release.outputs.upload_url }}
85-
asset_path: ./${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ env.PLATFORM }}.zip
86-
asset_name: ${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ env.PLATFORM }}.zip
87-
asset_content_type: application/zip
88-
- name: Upload Windows Release Asset
89-
id: upload-win64-release-asset
72+
name: ${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ matrix.platform }}
73+
path: ./
74+
- name: Upload Release Asset
9075
uses: actions/upload-release-asset@v1
9176
env:
9277
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93-
PLATFORM: windows-x64
9478
with:
95-
upload_url: ${{ steps.create_release.outputs.upload_url }}
96-
asset_path: ./${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ env.PLATFORM }}.zip
97-
asset_name: ${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ env.PLATFORM }}.zip
79+
upload_url: ${{ needs.create-release.outputs.upload_url }}
80+
asset_path: ./${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ matrix.platform }}.zip
81+
asset_name: ${{ env.REPO_NAME }}-${{ github.ref_name }}-${{ matrix.platform }}.zip
9882
asset_content_type: application/zip

0 commit comments

Comments
 (0)