[*] refactor #23
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: web | |
on: [push] | |
permissions: | |
contents: write | |
jobs: | |
action-run: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "π The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- run: echo "π‘ The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "The ${{ github.workspace }} is now ready to test your code on the runner." | |
- run: ls ${{ github.workspace }} | |
- run: sudo apt update | |
- run: echo "start install Rust..." | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
- run: echo "end install Rust..." | |
- run: echo "start install wasm-pack..." | |
- run: cargo install wasm-pack | |
- run: echo "start install wasm-pack..." | |
- run: echo "start build..." | |
- run: make web-build-dist | |
- run: echo "end build..." | |
- name: Get the release version from the tag | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- run: echo "start packing..." | |
- run: make app-name | |
- name: Export package | |
shell: bash | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
binary_name=`cat target/app-name` | |
output="$binary_name-${{ env.VERSION }}-web.tar.gz" | |
cp -rf web/dist dist | |
tar -zcf $output dist | |
echo "ASSET=$output" >> $GITHUB_ENV | |
- run: echo "end packing..." | |
- name: Upload the package | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
${{ env.ASSET }} | |
- run: echo "π This job's status is ${{ job.status }}." |