Build and Package #272
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: Build and Package | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 6 * * *" | |
permissions: | |
contents: write | |
actions: read | |
jobs: | |
build: | |
name: Build and Package | |
concurrency: | |
group: production-${{ github.ref }} | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install wasm-pack | |
uses: qmaru/[email protected] | |
- name: npm install and build | |
run: | | |
npm ci | |
npm run build | |
env: | |
CI: true | |
- name: Prepare artifact | |
run: | | |
mkdir artifact | |
rsync -av --exclude-from=.distignore . artifact/ | |
- name: Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rust-starter | |
path: artifact | |
retention-days: 3 | |
if-no-files-found: error | |
compression-level: 0 | |
- name: Update README | |
if: github.ref == 'refs/heads/main' | |
run: | | |
artifact_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
sed -i '/\[Latest Build\]/d' README.md | |
echo -e "\n[Latest Build]($artifact_url)" >> README.md | |
- name: Commit changes | |
if: github.ref == 'refs/heads/main' | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Update README with latest build link | |
file_pattern: 'README.md' |