fix(ci): bumped artifacts workflow to v4 #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
build-windows: | |
name: Build Windows and upload installer | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: '3.21.0' | |
- uses: microsoft/setup-msbuild@v1.1 | |
with: | |
vs-version: '17.0' | |
msbuild-architecture: 'x64' | |
- uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: a42af01b72c28a8e1d7b48107b33e4f286a55ef6 | |
- uses: repolevedavaj/install-nsis@v1.0.1 | |
with: | |
nsis-version: '3.09' | |
- name: Create build directory | |
run: mkdir -p build | |
- name: Configure | |
run: cmake -S . -B build --preset=release | |
- name: Build | |
run: cmake --build build --config Release -- /m:$(nproc) /p:TreatWarningsAsErrors=false | |
- name: Create installer | |
run: | | |
cd build | |
cpack -G NSIS | |
cd .. | |
- name: Upload installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: installers | |
path: build/R-Type-*.exe | |
build-linux: | |
name: Build Linux and upload installer | |
runs-on: [Linux, self-hosted] | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create build directory | |
run: mkdir -p build | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: a42af01b72c28a8e1d7b48107b33e4f286a55ef6 | |
- name: Configure | |
run: cmake -S . -B build --preset=release | |
- name: Build | |
run: cmake --build build --config Release -- -j$(nproc) | |
- name: Create installer | |
run: | | |
cd build | |
cpack -G DEB | |
cd .. | |
- name: Upload installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: installers | |
path: build/*.deb | |
release-installer: | |
name: Release the installers | |
runs-on: [Linux, self-hosted] | |
needs: [build-windows, build-linux] | |
steps: | |
- name: Download installers | |
uses: actions/download-artifact@v4 | |
with: | |
name: installers | |
path: installers | |
- uses: marvinpinto/action-automatic-releases@v1.2.1 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: ${{ github.ref == 'refs/heads/dev' && 'nightly-release' || 'release' }}${{ github.run_number }} | |
prerelease: ${{ github.ref == 'refs/heads/dev' }} | |
title: "R-Type build ${{ github.sha }}" | |
files: | | |
installers/*.exe | |
installers/*.deb |