-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change line endings to LF for release.yml * Trigger the release workflow on `push` * Update the apt repositories before installing dependencies * Change the action for publishing releases * Remove the version prefix from body text
- Loading branch information
Showing
1 changed file
with
146 additions
and
139 deletions.
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 |
---|---|---|
@@ -1,139 +1,146 @@ | ||
# This action will generate Windows|Linux|MacOS binary releases | ||
|
||
name: Release | ||
|
||
on: | ||
create: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build_release: | ||
name: Build release binaries | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target: x86_64-unknown-linux-gnu | ||
os: ubuntu-latest | ||
name: fishfight-x86_64-unknown-linux-gnu.tar.gz | ||
|
||
# https://github.com/actions-rs/cargo/issues/115 | ||
# Not able to use libs for linking: asound, GL, X11 and Xi in rust-embedded/cross. | ||
|
||
# - target: x86_64-unknown-linux-musl | ||
# os: ubuntu-latest | ||
# name: templa-rs-x86_64-unknown-linux-musl.tar.gz | ||
|
||
# - target: i686-unknown-linux-musl | ||
# os: ubuntu-latest | ||
# name: templa-rs-i686-unknown-linux-musl.tar.gz | ||
|
||
# - target: aarch64-unknown-linux-musl | ||
# os: ubuntu-latest | ||
# name: templa-rs-aarch64-unknown-linux-musl.tar.gz | ||
|
||
# - target: arm-unknown-linux-musleabihf | ||
# os: ubuntu-latest | ||
# name: templa-rs-arm-unknown-linux-musleabihf.tar.gz | ||
|
||
- target: x86_64-apple-darwin | ||
os: macOS-latest | ||
name: fishfight-x86_64-apple-darwin.tar.gz | ||
|
||
- target: aarch64-apple-darwin | ||
os: macOS-latest | ||
name: fishfight-aarch64-apple-darwin.tar.gz | ||
|
||
- target: x86_64-pc-windows-msvc | ||
os: windows-latest | ||
name: fishfight-x86_64-pc-windows-msvc.zip | ||
|
||
- target: i686-pc-windows-msvc | ||
os: windows-latest | ||
name: fishfight-i686-pc-windows-msvc.zip | ||
|
||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Dependencies | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get install -y libasound2-dev libgl1-mesa-dev libx11-dev libxi-dev | ||
- name: Cache Cargo | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
target: ${{ matrix.target }} | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk | ||
RUSTFLAGS: -L /usr/lib/x86_64-linux-gnu | ||
with: | ||
command: build | ||
args: --release --locked --target ${{ matrix.target }} | ||
# https://github.com/actions-rs/cargo/issues/115 | ||
# use-cross: ${{ matrix.os == 'ubuntu-latest' }} | ||
|
||
- name: Prepare artifacts [Windows] | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
cd target/${{ matrix.target }}/release | ||
strip fishfight.exe | ||
7z a ../../../${{ matrix.name }} fishfight.exe | ||
cd - | ||
- name: Prepare artifacts [Unix] | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
cd target/${{ matrix.target }}/release | ||
strip fishfight || true | ||
tar czvf ../../../${{ matrix.name }} fishfight | ||
cd - | ||
- name: Deploy | Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.name }} | ||
path: ${{ matrix.name }} | ||
|
||
publish_release: | ||
name: Create and Publish GitHub Release | ||
needs: build_release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Set the release version | ||
shell: bash | ||
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV | ||
|
||
- name: Generate Checksums | ||
run: for file in fishfight-*/fishfight-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done | ||
|
||
- name: Publish Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Release ${{ env.RELEASE_VERSION }} | ||
files: fishfight-*/fishfight-* | ||
# This action will generate Windows|Linux|MacOS binary releases | ||
|
||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build_release: | ||
name: Build release binaries | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target: x86_64-unknown-linux-gnu | ||
os: ubuntu-latest | ||
name: fishfight-x86_64-unknown-linux-gnu.tar.gz | ||
|
||
# https://github.com/actions-rs/cargo/issues/115 | ||
# Not able to use libs for linking: asound, GL, X11 and Xi in rust-embedded/cross. | ||
|
||
# - target: x86_64-unknown-linux-musl | ||
# os: ubuntu-latest | ||
# name: templa-rs-x86_64-unknown-linux-musl.tar.gz | ||
|
||
# - target: i686-unknown-linux-musl | ||
# os: ubuntu-latest | ||
# name: templa-rs-i686-unknown-linux-musl.tar.gz | ||
|
||
# - target: aarch64-unknown-linux-musl | ||
# os: ubuntu-latest | ||
# name: templa-rs-aarch64-unknown-linux-musl.tar.gz | ||
|
||
# - target: arm-unknown-linux-musleabihf | ||
# os: ubuntu-latest | ||
# name: templa-rs-arm-unknown-linux-musleabihf.tar.gz | ||
|
||
- target: x86_64-apple-darwin | ||
os: macOS-latest | ||
name: fishfight-x86_64-apple-darwin.tar.gz | ||
|
||
- target: aarch64-apple-darwin | ||
os: macOS-latest | ||
name: fishfight-aarch64-apple-darwin.tar.gz | ||
|
||
- target: x86_64-pc-windows-msvc | ||
os: windows-latest | ||
name: fishfight-x86_64-pc-windows-msvc.zip | ||
|
||
- target: i686-pc-windows-msvc | ||
os: windows-latest | ||
name: fishfight-i686-pc-windows-msvc.zip | ||
|
||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Dependencies | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --allow-unauthenticated -y -qq \ | ||
libasound2-dev libgl1-mesa-dev libx11-dev libxi-dev | ||
- name: Cache Cargo | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
target: ${{ matrix.target }} | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk | ||
RUSTFLAGS: -L /usr/lib/x86_64-linux-gnu | ||
with: | ||
command: build | ||
args: --release --locked --target ${{ matrix.target }} | ||
# https://github.com/actions-rs/cargo/issues/115 | ||
# use-cross: ${{ matrix.os == 'ubuntu-latest' }} | ||
|
||
- name: Prepare artifacts [Windows] | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
cd target/${{ matrix.target }}/release | ||
strip fishfight.exe | ||
7z a ../../../${{ matrix.name }} fishfight.exe | ||
cd - | ||
- name: Prepare artifacts [Unix] | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
cd target/${{ matrix.target }}/release | ||
strip fishfight || true | ||
tar czvf ../../../${{ matrix.name }} fishfight | ||
cd - | ||
- name: Deploy | Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.name }} | ||
path: ${{ matrix.name }} | ||
|
||
publish_release: | ||
name: Create and Publish GitHub Release | ||
needs: build_release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Set the release version | ||
shell: bash | ||
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV | ||
|
||
- name: Generate Checksums | ||
run: for file in fishfight-*/fishfight-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done | ||
|
||
- name: Publish Release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
release_name: Release ${{ env.RELEASE_VERSION }} | ||
file: fishfight-*/fishfight-* | ||
file_glob: true | ||
overwrite: true | ||
body: "FishFight ${{ env.RELEASE_VERSION }} 🐟" | ||
tag: ${{ github.ref }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} |