Skip to content

- Update workflow

- Update workflow #3

Workflow file for this run

on:
push:
branches: [ main, ci* ]
tags: [ v* ]
pull_request:
branches: [ main ]
jobs:
get-info:
runs-on: ubuntu-latest
outputs:
commit-hash: ${{ steps.git-info.outputs.commit-hash }}
steps:
- uses: actions/checkout@v4
- name: Get git info
id: git-info
shell: bash
run: |
COMMIT_HASH=$(git rev-parse --short ${{ GITHUB.SHA }})
echo "commit-hash=$COMMIT_HASH" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: get-info
env:
OUTPUT_FOLDER: 'pkg'
RELEASE_FOLDER: 'release'
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:

Check failure on line 31 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

You have an error in your yaml syntax on line 31
toolchain: 'nightly',
target: 'wasm32-unknown-unknown'
- name: Build with wasm-pack
run: |
cargo install wasm-pack
wasm-pack build
- name: List files
run: |
ls -la
ls -la pkg
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: diff-match-patch-wasm_${{ needs.get-info.outputs.commit-hash }}_#${{ GITHUB.RUN_NUMBER }}
path: ${{ env.OUTPUT_FOLDER }}
- name: Prepare for release
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
mkdir -p ${{ env.RELEASE_FOLDER }}
7z a -tzip ${{ env.RELEASE_FOLDER }}/diff-match-patch-wasm.zip ${{ env.OUTPUT_FOLDER }}/*
- name: Create release
if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: ${{ env.RELEASE_FOLDER }}/diff-match-patch-wasm.zip