-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 changed file
with
56 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build and Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- '!*' | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
app-name: 'confluence-updater' | ||
|
||
jobs: | ||
rustfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- run: rustup component add rustfmt | ||
- run: cargo fmt -- --check | ||
|
||
build-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Cache Rust dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: target | ||
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.OS }}-build- | ||
- name: Install latest rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: beta | ||
default: true | ||
override: true | ||
|
||
- name: Build | ||
run: | | ||
sudo apt update && sudo apt install musl-tools | ||
rustup target add x86_64-unknown-linux-musl | ||
cargo build --release --target x86_64-unknown-linux-musl | ||
strip target/x86_64-unknown-linux-musl/release/${{ env.app-name }} | ||
mv target/x86_64-unknown-linux-musl/release/${{ env.app-name }} target/x86_64-unknown-linux-musl/release/${{ env.app-name }}-x86_64-unknown-linux-musl | ||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: target/x86_64-unknown-linux-musl/release/${{ env.app-name }}-x86_64-unknown-linux-musl | ||
asset_name: ${{ env.app-name }}-x86_64-unknown-linux-musl | ||
tag: ${{ github.ref }} | ||
overwrite: true |