Skip to content

Update github actions to v4 #55

Update github actions to v4

Update github actions to v4 #55

Workflow file for this run

name: Rust
on:
push:
branches: ["canon"]
pull_request:
branches: ["canon"]
env:
CARGO_TERM_COLOR: always
release_name: build_${{github.run_number}}
# an=artifact_name
an_napoli_pain: napoli-pain-wasm.tar.gz
jobs:
build:
runs-on: ubuntu-22.04
environment: "build"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: arduino/setup-protoc@v1
- uses: jetli/trunk-action@v0.4.0
with:
# Optional version of trunk to install(eg. 'v0.16.0', 'latest')
version: "latest"
- name: Build All
run: cargo build --verbose
- name: Run all tests
run: cargo test --verbose
- name: Build release for ${{ env.an_napoli_pain }}
run: |
cd napoli-pain
trunk build --release true index.html
tar -czvf ${{ env.an_napoli_pain }} dist/
env:
BACKEND_URL: ${{ vars.BACKEND_URL }}
- name: Upload ${{ env.an_napoli_pain }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.an_napoli_pain }}
path: napoli-pain/${{ env.an_napoli_pain }}
retention-days: 5
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: "Create Release"
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y hub
hub release create ${{ env.release_name }} -m ${{ env.release_name }} -a artifacts/${{ env.an_napoli_pain }}/${{ env.an_napoli_pain }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}