mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
fix github actions
This commit is contained in:
parent
647567b480
commit
a8cb527205
2 changed files with 62 additions and 31 deletions
85
.github/workflows/main.yml
vendored
85
.github/workflows/main.yml
vendored
|
@ -1,46 +1,77 @@
|
|||
name: Scram My Shit
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
- name: Setup Rust Toolchain
|
||||
run: |
|
||||
rustup toolchain install stable --profile minimal
|
||||
rustup target add wasm32-unknown-unknown
|
||||
cargo install wasm-bindgen-cli
|
||||
sudo apt-get update && sudo apt-get install -y binaryen
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Setup Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
- name: Build Rewriter
|
||||
run: npm run rewriter:build
|
||||
|
||||
- name: Install wasm32 toolchain
|
||||
run: rustup target add wasm32-unknown-unknown
|
||||
- name: Build Scramjet
|
||||
run: npm run build
|
||||
|
||||
- name: Install wasm-bindgen-cli
|
||||
run: cargo install wasm-bindgen-cli
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: scramjet
|
||||
path: |
|
||||
dist/*.js
|
||||
dist/*.js.map
|
||||
|
||||
- name: Install wasm-opt
|
||||
run: sudo apt-get update && sudo apt-get install -y binaryen
|
||||
upload:
|
||||
name: Upload release
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/main'
|
||||
|
||||
- name: Build Rewriter
|
||||
run: npm run rewriter:build
|
||||
steps:
|
||||
- name: Delete old release and tag
|
||||
uses: dev-drprasad/delete-tag-and-release@v1.0.1
|
||||
with:
|
||||
delete_release: true
|
||||
tag_name: latest
|
||||
github_token: ${{ github.token }}
|
||||
|
||||
- name: Get artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: scramjet
|
||||
path: build
|
||||
|
||||
- name: Run npm build
|
||||
run: npm run build
|
||||
- name: Display structure of downloaded files
|
||||
run: ls -R
|
||||
|
||||
- name: Zip files
|
||||
run: zip -r scramjet.zip build/
|
||||
|
||||
- name: Release to GitHub
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
name: Continuous Build
|
||||
tag: latest
|
||||
commit: main
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
artifacts: "scramjet.zip"
|
||||
prerelease: true
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"build": "rspack build --mode production",
|
||||
"rewriter:build": "cd rewriter && bash build.sh && cd ..",
|
||||
"dev": "node server.js",
|
||||
"prepublish": "npm run build",
|
||||
"prepack": "npm run build",
|
||||
"pub": "npm publish --no-git-checks --access public",
|
||||
"format": "prettier --config .prettierrc.js --write .",
|
||||
"lint": "eslint ./src/",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue