fix github actions

This commit is contained in:
Percs 2024-10-12 18:49:52 -05:00
parent 647567b480
commit a8cb527205
2 changed files with 62 additions and 31 deletions

View file

@ -1,12 +1,8 @@
name: Scram My Shit name: CI
on: on:
push: push:
branches:
- main
pull_request: pull_request:
branches:
- main
jobs: jobs:
build: build:
@ -14,33 +10,68 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: '18' 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 - name: Install dependencies
run: npm install run: npm install
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install wasm32 toolchain
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-bindgen-cli
run: cargo install wasm-bindgen-cli
- name: Install wasm-opt
run: sudo apt-get update && sudo apt-get install -y binaryen
- name: Build Rewriter - name: Build Rewriter
run: npm run rewriter:build run: npm run rewriter:build
- name: Build Scramjet
- name: Run npm build
run: npm run build run: npm run build
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: scramjet
path: |
dist/*.js
dist/*.js.map
upload:
name: Upload release
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
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: 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

View file

@ -12,7 +12,7 @@
"build": "rspack build --mode production", "build": "rspack build --mode production",
"rewriter:build": "cd rewriter && bash build.sh && cd ..", "rewriter:build": "cd rewriter && bash build.sh && cd ..",
"dev": "node server.js", "dev": "node server.js",
"prepublish": "npm run build", "prepack": "npm run build",
"pub": "npm publish --no-git-checks --access public", "pub": "npm publish --no-git-checks --access public",
"format": "prettier --config .prettierrc.js --write .", "format": "prettier --config .prettierrc.js --write .",
"lint": "eslint ./src/", "lint": "eslint ./src/",