Skip to content

Commit

Permalink
Switch to stable Rust now that v1.49 is released, simplify GitHub wor…
Browse files Browse the repository at this point in the history
…kflow
  • Loading branch information
richiksc committed Jan 1, 2021
1 parent 45d410c commit d1de353
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 65 deletions.
7 changes: 0 additions & 7 deletions .ci/cross-build.sh

This file was deleted.

17 changes: 11 additions & 6 deletions .ci/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ mkdir -p out/badlogvis-$TARGET
cp target/release/badlogvis out/badlogvis-$TARGET/
cp .ci/install.sh out/badlogvis-$TARGET/

if [[ -n "$ARM" ]]; then
mkdir -p out/badlogvis-$ARM
cp target/$ARM/release/badlogvis out/badlogvis-$ARM/
cp .ci/install.sh out/badlogvis-$ARM/
mkdir -p out/badlogvis-$SECONDARY

if [[ "$SECONDARY" != "x86_64-pc-windows-gnu" ]]; then
cp .ci/install.sh out/badlogvis-$SECONDARY/
cp target/$SECONDARY/release/badlogvis out/badlogvis-$SECONDARY/
else
cp target/$SECONDARY/release/badlogvis.exe out/badlogvis-$SECONDARY/
fi

cd out/
tar -czvf badlogvis-$TARGET.tar.gz badlogvis-$TARGET/

if [[ -n "$ARM" ]]; then
tar -czvf badlogvis-$ARM.tar.gz badlogvis-$ARM/
if [[ "$SECONDARY" != "x86_64-pc-windows-gnu" ]]; then
tar -czvf badlogvis-$SECONDARY.tar.gz badlogvis-$SECONDARY/
else
zip -r badlogvis-$SECONDARY.zip badlogvis-$SECONDARY/
fi

78 changes: 26 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,75 +5,49 @@ on:
- 'v*'

jobs:
build-macos:
name: Build for macOS
runs-on: macos-11.0
env:
TARGET: x86_64-apple-darwin
ARM: aarch64-apple-darwin
build:
strategy:
matrix:
include:
- os: macos-11.0
TARGET: x86_64-apple-darwin
SECONDARY: aarch64-apple-darwin
- os: ubuntu-latest
TARGET: x86_64-unknown-linux-gnu
SECONDARY: x86_64-pc-windows-gnu
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install Rust beta
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: beta
toolchain: stable
default: true
target: ${{ env.ARM }} # This is in addition to the native target
target: ${{ matrix.SECONDARY }} # This is in addition to the native target
profile: minimal
- name: Build for x86_64-apple-darwin
- name: Build for ${{ matrix.TARGET }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Build for aarch64-apple-darwin
- name: Install Windows linker
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install gcc-mingw-w64 &&
printf "[x86_64-pc-windows-gnu]\nlinker = \"x86_64-w64-mingw32-gcc\"" >> ~/.cargo/config
- name: Build for ${{ matrix.SECONDARY }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ env.ARM }}
args: --release --target ${{ matrix.SECONDARY }}
- name: Package binaries
id: package_binaries
run: .ci/package.sh
- name: Publish release with binaries
id: publish_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.RELEASE_VERSION }}
name: badlogvis ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
files: |
./out/badlogvis-*.tar.gz
build-linux:
name: Build for Linux and Windows
runs-on: ubuntu-latest
env:
TARGET: x86_64-unknown-linux-gnu
WIN: x86_64-pc-windows-gnu
steps:
- uses: actions/checkout@v2
- name: Set Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install Rust beta
uses: actions-rs/toolchain@v1
with:
toolchain: beta
default: true
target: ${{ env.WIN }} # This is in addition to the native target
profile: minimal
- name: Build for x86_64-unknown-linux-gnu
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Build for x86_64-pc-windows-gnu
id: build_windows
run: .ci/cross-build.sh
- name: Package binaries
id: package_binaries
TARGET: ${{ matrix.TARGET }}
SECONDARY: ${{ matrix.SECONDARY }}
run: .ci/package.sh
- name: Publish release with binaries
id: publish_release
Expand All @@ -86,7 +60,7 @@ jobs:
draft: false
prerelease: false
files: |
./target/release/badlogvis-${{ env.WIN }}.exe
./out/badlogvis-*.tar.gz
./out/badlogvis-*.zip

0 comments on commit d1de353

Please sign in to comment.