Skip to content

Commit

Permalink
Update CI and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleidawave committed Sep 25, 2023
1 parent 8b658c2 commit ebbb3b1
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Get version
id: get-version
run: |
version=$(git tag --list 'release/main-*' --sort=-taggerdate | head -n 1)
version=$(git tag --list 'release/main-*' --sort=-taggerdate | tail -n 1)
echo "Releasing ${version:13}"
echo "new-ezno-version=${version:13}" >> $GITHUB_OUTPUT
Expand Down
90 changes: 0 additions & 90 deletions .github/workflows/npm-release.yml

This file was deleted.

52 changes: 48 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: (main) Crates release
name: Release on Crates and NPM

on:
workflow_dispatch:
Expand Down Expand Up @@ -31,7 +31,7 @@ env:
target/
jobs:
crates-publish:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -86,7 +86,52 @@ jobs:
version: ${{ steps.set-arguments.outputs.publish-json-args }}
crates-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

- name: Push updated manifests
- name: Add WASM to rustup
if: ${{ github.event.inputs.ezno-version != 'none' }}
run: rustup target add wasm32-unknown-unknown

- uses: brndnmtthws/rust-action-cargo-binstall@v1
if: ${{ github.event.inputs.ezno-version != 'none' }}
with:
packages: wasm-bindgen-cli

- name: Set NPM package version & build
id: set-npm-version
if: ${{ github.event.inputs.ezno-version != 'none' }}
run: |
VERSION=$('${{ steps.release.outputs.new-versions-json-object }}' | jq -r '.ezno')
echo "new-ezno-version=${VERSION}" >> $GITHUB_OUTPUT
npm ci
npm version $VERSION
npm run build-release
# TODO temp here:
ls dist
working-directory: src/js-cli-and-library

- name: NPM publish (cli and library)
if: ${{ github.event.inputs.ezno-version != 'none' }}
uses: rxfork/npm-publish@v1
with:
token: ${{ secrets.NPM_REGISTRY_TOKEN }}
package: src/js-cli-and-library/package.json

- name: Update JS plugin version and dependencies
if: ${{ github.event.inputs.ezno-version != 'none' }}
run: |
# Hopefully propagated in 20 seconds
sleep 20
npm ci
npm install ezno@${{ steps.set-npm-version.outputs.new-ezno-version }}
npm version ${{ steps.set-npm-version.outputs.new-ezno-version }}
working-directory: src/js-based-plugin

- name: NPM publish (plugin)
uses: rxfork/npm-publish@v1
with:
token: ${{ secrets.NPM_REGISTRY_TOKEN }}
package: src/js-based-plugin/package.json

- name: Push updated manifests (Cargo.toml and package.json)
run: |
# Create tags
echo '${{ steps.release.outputs.new-versions }}' | jq -r '.[]' | while read -r update; do
Expand All @@ -98,7 +143,6 @@ jobs:
git add .
git commit -m "Release: ${{ steps.release.outputs.new-versions-description }}"
git push --tags origin main
sleep 20
- name: Discord
uses: dusmartijngames/discord-webhook-notify@master
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ jobs:
if: steps.changes.outputs.parser == 'true'
run: |
cargo test
# TODO test other big libraries
curl https://esm.sh/v128/[email protected]/es2022/react-dom.mjs > react.js
cargo run -p ezno-parser --example parse react.js
cargo run -p ezno-parser --example parse react.js > /dev/null
cargo test -p ezno-ast-generator
working-directory: parser

- name: Run checker specification
Expand Down
2 changes: 1 addition & 1 deletion parser/examples/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = Module::from_file(&path, ParseOptions::default(), &mut fs);
match result {
Ok(module) => {
println!("Parsed in: {:?}", now.elapsed());
eprintln!("Parsed in: {:?}", now.elapsed());
if std::env::args().any(|item| item == "--ast") {
println!("{module:#?}");
} else {
Expand Down
1 change: 0 additions & 1 deletion parser/fuzz/fuzz_targets/module_roundtrip_naive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ fn do_fuzz(data: &str) -> Corpus {
Default::default(),
SourceId::NULL,
None,
Vec::new(),
) else {
return Corpus::Reject
};
Expand Down
1 change: 0 additions & 1 deletion parser/fuzz/fuzz_targets/module_roundtrip_structured.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ fn do_fuzz(data: common::FuzzSource) -> Corpus {
Default::default(),
SourceId::NULL,
None,
Vec::new(),
) else {
return Corpus::Reject
};
Expand Down

0 comments on commit ebbb3b1

Please sign in to comment.