Prepare release #49
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
name: Main CI | |
on: | |
push: ~ | |
pull_request: ~ | |
jobs: | |
build: | |
name: Building ${{ matrix.target }} for ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [release, development] | |
os: | |
- ubuntu-latest | |
env: | |
RUST_BACKTRACE: full | |
PAGOO_LOG: trace | |
RELEASE: ${{ (matrix.target == 'release' && '1') || '0' }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- { name: "Checkout the code", uses: actions/checkout@v2 } | |
- name: 🗄️ Setup Rust cache | |
uses: actions/cache@v2 | |
with: | |
key: ${{ matrix.os }}-${{ hashFiles('Cargo.lock') }} | |
path: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git | |
./target | |
- name: 🦀 Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: { toolchain: stable } | |
- name: 🔌 Download Rust dependencies | |
run: cargo fetch | |
- name: 🏗️ 💽 Build application | |
run: make build | |
- name: 🧪 Run all tests | |
run: make test | |
- name: 🗃 Store Linux artifacts (release only) | |
uses: actions/upload-artifact@v4 | |
if: startsWith(github.ref, 'refs/tags/v') && matrix.target == 'release' | |
with: | |
name: compotes_artifacts_${{ matrix.os }} | |
overwrite: true | |
path: | | |
target/release/pagoo | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create release | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: ${{ steps.version.outputs.version }} | |
tag_name: ${{ github.ref }} | |
#body_path: CHANGELOG.md | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: 🗃 Download built artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: target/release | |
merge-multiple: true | |
- name: Upload Linux executable | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/release/pagoo | |
asset_name: pagoo_${{ github.ref_name }} | |
tag: ${{ github.ref_name }} | |
overwrite: true | |
file_glob: true |