You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
3.7 KiB
YAML

on:
push:
tags:
- "v*"
name: Release
env:
GITHUB_REF: "${{ github.ref }}"
CARGO_TERM_COLOR: always
VERSION: ${GITHUB_REF:10}
jobs:
build_64bit:
name: Build artifacts (64-bit)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
artifact: x86_64-linux-gnu
rust: x86_64-unknown-linux-gnu
- os: macos-latest
artifact: x86_64-macos
rust: x86_64-apple-darwin
- os: windows-latest
artifact: x86_64-windows
rust: x86_64-pc-windows-msvc
env:
RUST_BACKTRACE: 1
TARGET: ${{ matrix.rust }}
ARTIFACT: ${{ matrix.artifact }}
VERSION: ${{ env.VERSION }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
name: Restore cache
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.rust }}-${{ hashFiles('**/lockfiles') }}
- name: Install Rust
run: |
rustup default stable
rustup target add ${{ matrix.rust }}
- name: Make bundle
run: make bundle
- name: Build Linux packages
run: make deb
if: runner.os == 'Linux'
- name: Upload assets
uses: actions/upload-artifact@v2
with:
name: |
*.zip
*.deb
path: packages
build_32bit:
name: Build artifacts (32-bit)
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, windows]
include:
- build: linux
os: ubuntu-latest
rust: i686-unknown-linux-gnu
artifact: i686-linux-gnu
- build: windows
os: windows-latest
artifact: i686-windows
rust: i686-pc-windows-msvc
- build: linux
os: ubuntu-latest
rust: x86_64-unknown-linux-musl
artifact: x86_64-linux-musl
env:
RUST_BACKTRACE: 1
TARGET: ${{ matrix.rust }}
ARTIFACT: ${{ matrix.artifact }}
VERSION: ${{ env.VERSION }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
name: Restore cache
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.rust }}-${{ hashFiles('**/lockfiles') }}
- name: Install 32-bit tools (Linux)
run: sudo apt update && sudo apt install gcc-multilib -y
if: runner.os == 'Linux'
- name: Install MUSL tools
run: sudo apt update && sudo apt install musl-tools -y
if: matrix.rust == 'x86_64-unknown-linux-musl'
- name: Install Rust
run: rustup target add ${{ matrix.rust }}
- name: Make bundle
run: make bundle
- name: Build Linux packages
run: make deb
if: runner.os == 'Linux'
- name: Upload assets
uses: actions/upload-artifact@v2
with:
name: |
*.zip
*.deb
path: packages
release:
name: Release
needs:
- build_64bit
- build_32bit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download all artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Upload release binaries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ env.VERSION }}
run: |
hub release edit $(find . -type f -name "*.zip" -printf "-a %p ") -m "" "$TAG_NAME"
hub release edit $(find . -type f -name "*.deb" -printf "-a %p ") -m "" "$TAG_NAME"