Switched from dotenv to dotenvy #38
Workflow file for this run
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
on: | |
pull_request: | |
push: | |
paths: | |
- "src/**" | |
- "Cargo*" | |
branches: | |
- master | |
tags: | |
- "v*.*.*" | |
name: Build and publish binaries | |
jobs: | |
build-and-publish: | |
name: Build and publish | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- aarch64-unknown-linux-musl | |
- x86_64-unknown-linux-gnu | |
- x86_64-pc-windows-gnu | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
targets: ${{ matrix.target }} | |
- name: Install cross | |
run: cargo install cross --git https://github.com/cross-rs/cross | |
- name: Setup cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cross build --release --target=${{ matrix.target }} | |
- name: Tar up binaries | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
if [[ ${{ matrix.target }} == "x86_64-pc-windows-gnu" ]]; then | |
mv target/${{ matrix.target }}/release/sbot.exe . | |
chmod +x sbot.exe | |
else | |
mv target/${{ matrix.target }}/release/sbot . | |
chmod +x sbot | |
fi | |
tar czvf sbot-${{ matrix.target }}.tar.gz sbot* | |
- name: Publish binaries to release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "sbot*.tar.gz" | |
generate_release_notes: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |