๐ ยป publish #6
Workflow file for this run
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: "๐ ยป publish" | |
on: | |
release: | |
types: [published] | |
concurrency: | |
group: publish-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: 'bash' | |
jobs: | |
build: | |
name: ๐๏ธ ยป build | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- os_name: linux-x86_64 | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
bin: kurv | |
archive: kurv-linux-x86_64.tar.gz | |
- os_name: windows-x86_64 | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
bin: kurv.exe | |
archive: kurv-windows-x86_64.zip | |
steps: | |
- name: ๐ ยป log run info | |
run: | | |
echo "os: ${{ matrix.platform.os }}" | |
echo "os_name: ${{ matrix.platform.os_name }}" | |
echo "target: ${{ matrix.platform.target }}" | |
echo "bin: ${{ matrix.platform.bin }}" | |
echo "archive: ${{ matrix.platform.archive }}" | |
echo "run_id: ${{ github.run_id }}" | |
- name: ๐ ยป checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: ๐๏ธ ยป cache cargo | |
uses: Swatinem/rust-cache@v2 | |
- name: ๐๏ธ ยป build kurv | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
cross-version: | |
command: "build" | |
target: ${{ matrix.platform.target }} | |
args: "--release" | |
- name: ๐ฆ ยป archive kurv release | |
shell: bash | |
run: | | |
cd target/${{ matrix.platform.target }}/release | |
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then | |
7z a ../../../${{ matrix.platform.archive }} ${{ matrix.platform.bin }} | |
else | |
tar czvf ../../../${{ matrix.platform.archive }} ${{ matrix.platform.bin }} | |
fi | |
cd - | |
- name: ๐ค ยป upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kurv-${{ matrix.platform.os_name }} | |
path: ${{ matrix.platform.archive }} | |
publish-gh-release: | |
name: ๐ ยป publish github release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: ๐ ยป log run info | |
run: | | |
echo "run_id: ${{ github.run_id }}" | |
- name: ๐ฅ ยป download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: kurv-* | |
merge-multiple: true | |
- name: ๐ ยป list files | |
run: ls -l -a -R | |
- name: ๐ ยป upload artifacts to github release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
kurv-* |