Bump actions/upload-artifact from 3 to 4 #21
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: | |
tags: | |
- "*.*.*" | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
compile: | |
strategy: | |
fail-fast: false | |
matrix: | |
gcc: [ 12 ] | |
os: [ ubuntu, macos ] | |
version: [ '22.04', latest ] | |
exclude: | |
- os: ubuntu | |
version: latest | |
- os: windows | |
version: '22.04' | |
- os: macos | |
version: '22.04' | |
runs-on: ${{ matrix.os }}-${{ matrix.version }} | |
defaults: | |
run: | |
working-directory: native | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v4 | |
- name: Setup GCC ${{ matrix.gcc }} | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt update | |
sudo apt install gcc-${{ matrix.gcc }} | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 110 | |
- name: Setup MSVC compiler | |
if: contains(matrix.os, 'windows') | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Compile to libsecretsharing | |
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') | |
run: | | |
gcc -c -fPIC -o bridge.o bridge.c | |
gcc -c -fPIC -o secret_sharing.o secret_sharing.c | |
gcc -shared -W -o libsecretsharing.so bridge.o secret_sharing.o | |
- name: Rename dynamic lib for macOS | |
if: contains(matrix.os, 'macos') | |
run: mv libsecretsharing.so libsecretsharing.dylib | |
- name: Compile to libsecretsharing.dll | |
if: contains(matrix.os, 'windows') | |
run: cl /LD bridge.c secret_sharing.c /link /EXPORT:secretsharing | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-${{ github.sha }} | |
path: | | |
./native/libsecretsharing.so | |
./native/libsecretsharing.dll | |
./native/libsecretsharing.dylib | |
if-no-files-found: error | |
retention-days: 1 | |
publish: | |
needs: [ compile ] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
environment: release | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: release-${{ github.sha }} | |
- name: Publish release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
libsecretsharing.so | |
libsecretsharing.dll | |
libsecretsharing.dylib |