Skip to content

Commit

Permalink
Added build config
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwood committed Nov 14, 2021
1 parent 094f6a4 commit 71a6bf6
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build-n-release.yml
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

0 comments on commit 71a6bf6

Please sign in to comment.