-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
eec5b7f
commit 5e53280
Showing
1 changed file
with
36 additions
and
36 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 |
---|---|---|
|
@@ -2,54 +2,53 @@ name: Rust | |
|
||
on: | ||
push: | ||
branches: [ "canon" ] | ||
branches: ["canon"] | ||
pull_request: | ||
branches: [ "canon" ] | ||
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@v3 | ||
- uses: actions/cache@v3 | ||
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/[email protected] | ||
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 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@v3 | ||
with: | ||
name: ${{ env.an_napoli_pain }} | ||
path: napoli-pain/${{ env.an_napoli_pain }} | ||
retention-days: 5 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
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/[email protected] | ||
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 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@v3 | ||
with: | ||
name: ${{ env.an_napoli_pain }} | ||
path: napoli-pain/${{ env.an_napoli_pain }} | ||
retention-days: 5 | ||
|
||
release: | ||
needs: build | ||
|
@@ -61,9 +60,10 @@ jobs: | |
with: | ||
path: artifacts | ||
|
||
- name: 'Create Release' | ||
- 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 }} |