chore: ci build for MacOS arm + intel #612
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: Build | |
on: | |
push: | |
branches: [ '*' ] | |
tags: | |
- v* | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-docker: | |
runs-on: ubuntu-latest | |
container: docker://hhmhh/weylus_build:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: deps/dist* | |
key: ${{ runner.os }}-deps-${{ hashFiles('deps/*') }} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} | |
- name: Build | |
run: ./docker_build.sh | |
shell: bash | |
- name: Artifacts1 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux | |
path: packages/weylus-linux.zip | |
- name: Artifacts2 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-deb | |
path: packages/Weylus*.deb | |
- name: Artifacts3 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: packages/weylus-windows.zip | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
packages/weylus-linux.zip | |
packages/Weylus*.deb | |
packages/weylus-windows.zip | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-docker-alpine: | |
runs-on: ubuntu-latest | |
container: docker://hhmhh/weylus_build_alpine:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: deps/dist* | |
key: ${{ runner.os }}-alpine-deps-${{ hashFiles('deps/*') }} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-alpine-cargo-${{ hashFiles('Cargo.lock') }} | |
- name: Build | |
run: RUSTFLAGS='-C target-feature=-crt-static' cargo build --release && cd target/release && tar czf weylus-linux-alpine-musl.tar.gz weylus | |
shell: bash | |
- name: Artifacts1 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-alpine-musl | |
path: target/release/weylus-linux-alpine-musl.tar.gz | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
target/release/weylus-linux-alpine-musl.tar.gz | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-macos: | |
strategy: | |
matrix: | |
os: [macos-latest, macos-13] # -latest if for Apple Silicon, -13 is for Intel | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: deps/dist | |
key: ${{ runner.os }}-deps-${{ hashFiles('deps/*') }} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} | |
- name: Download deps | |
run: | | |
npm install -g typescript | |
brew install nasm | |
cargo install cargo-bundle | |
shell: bash | |
- name: Build | |
# run: MACOSX_DEPLOYMENT_TARGET=10.13 cargo bundle --release | |
run: cargo bundle --release | |
- name: Package | |
run: | | |
MACOS_BUILD_NAME=macos-$([ "${{ matrix.os }}" == "macos-latest" ] && echo "arm" || echo "intel") | |
echo "MACOS_BUILD_NAME=$MACOS_BUILD_NAME" >> $GITHUB_ENV | |
cd target/release/bundle/osx/ && zip -r ${MACOS_BUILD_NAME}.zip Weylus.app | |
- name: Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.MACOS_BUILD_NAME }} | |
path: target/release/bundle/osx/${{ env.MACOS_BUILD_NAME }}.zip | |
- name: ArtifactsDebug | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}-ffbuild | |
path: | | |
deps/ffmpeg/ffbuild | |
- name: Debug via SSH | |
if: failure() | |
uses: luchihoratiu/debug-via-ssh@main | |
with: | |
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} | |
SSH_PASS: ${{ secrets.SSH_PASS }} | |
NGROK_REGION: eu | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
target/release/bundle/osx/macOS.zip | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |