-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: profile.release builds | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
name: Build on ${{ matrix.build }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
build: [linux-amd64, macos-x86_64] #, linux-aarch64, macos-arm64] | ||
include: | ||
- build: linux-amd64 | ||
os: ubuntu-latest | ||
rust: stable | ||
artifact_name: 'gerb-linux-amd64' | ||
target: x86_64-unknown-linux-gnu | ||
- build: macos-x86_64 | ||
os: macos-latest | ||
rust: stable | ||
target: x86_64-apple-darwin | ||
artifact_name: 'gerb-darwin-amd64' | ||
#- build: linux-aarch64 | ||
# os: ubuntu-latest | ||
# rust: stable | ||
# target: aarch64-unknown-linux-gnu | ||
# artifact_name: 'gerb-linux-aarch64' | ||
#- build: macos-arm64 | ||
# os: macos-latest | ||
# rust: stable | ||
# target: aarch64-apple-darwin | ||
# artifact_name: 'gerb-darwin-arm64' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Rust ${{ matrix.rust }} | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
target: ${{ matrix.target }} | ||
override: true | ||
- name: Configure cargo data directory | ||
# After this point, all cargo registry and crate data is stored in | ||
# $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files | ||
# that are needed during the build process. Additionally, this works | ||
# around a bug in the 'cache' action that causes directories outside of | ||
# the workspace dir to be saved/restored incorrectly. | ||
run: echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV | ||
- name: Setup Rust target | ||
if: matrix.target | ||
run: | | ||
mkdir -p .cargo | ||
cat << EOF > .cargo/config.toml | ||
[build] | ||
target = "${{ matrix.target }}" | ||
EOF | ||
- name: Install dependencies (macos x86_64) | ||
if: matrix.os == 'macos-latest' && matrix.target == 'x86_64-apple-darwin' | ||
shell: bash | ||
run: | | ||
set -ex | ||
brew install librsvg gtk+3 | ||
- name: Install dependencies (macos arm64) | ||
if: matrix.os == 'macos-latest' && matrix.target == 'aarch64-apple-darwin' | ||
shell: bash | ||
run: | | ||
set -ex | ||
#arch -arm64e bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | ||
#arch -arm64e brew install librsvg gtk+3 | ||
#brew fetch --force --deps --bottle-tag=arm64_big_sur librsvg gtk+3 | tee brew.out | ||
#for t in `grep "Downloaded to" < brew.out | cut -f 3 -d ' '`; do | ||
# brew install "$t" | ||
#done | ||
- name: Install dependencies (linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
set -ex | ||
sudo apt install libgtk-3-dev | ||
- name: Build binary | ||
run: | | ||
cargo build --release | ||
mv target/*/release/gerb target/gerb || true | ||
mv target/release/gerb target/gerb || true | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.artifact_name }} | ||
path: target/gerb | ||
if-no-files-found: error | ||
retention-days: 30 |
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