Skip to content

Commit

Permalink
Fix scripting release (#139)
Browse files Browse the repository at this point in the history
* Fixed release workflow

- script was grepping for 'version = ' anywhere in the Cargo.toml. Now that the version is further down, add a ^version check to find the one at the start of a line
- Fixed the config-gen build to find build files based on config rather than hdr

* Updated dependencies

* Updated additional dependencies. Some held back due to breaking changes
  • Loading branch information
tkmcmaster committed Aug 15, 2023
1 parent 22d3539 commit 778f1c6
Show file tree
Hide file tree
Showing 5 changed files with 513 additions and 475 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo PRERELEASE=true >> $GITHUB_ENV
else
# check that the version in Cargo.toml is equal to the tag
grep -q "version = \"${version}\"" Cargo.toml || (echo "$(tput setaf 1)Tag version did NOT match version in Cargo.toml" && false)
grep -q "^version = \"${version}\"" Cargo.toml || (echo "$(tput setaf 1)Tag version did NOT match version in Cargo.toml" && false)
echo PRERELEASE=false >> $GITHUB_ENV
fi
shell: bash
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
version=${VERSION/v/}
# replace the version value in Cargo.toml with the tag version (so we don't need to create extraneous commits for every preview version)
cp Cargo.toml Cargo2.toml
sed "0,/version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
sed "0,/^version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
- name: Install Linker
if: matrix.cross
Expand Down Expand Up @@ -188,11 +188,13 @@ jobs:


wasm-release-config:
name: Wasm Pack and Upload Config Parser
name: Wasm Pack and Upload Node Release
needs: ['create-release']
strategy:
matrix:
wasm-dirctory: [config-wasm]
include:
- wasm-dirctory: config-wasm
file-prefix: config
runs-on: ubuntu-latest
env:
working-directory: ./lib/${{ matrix.wasm-dirctory }}
Expand Down Expand Up @@ -221,7 +223,7 @@ jobs:
version=${VERSION/v/}
# replace the version value in Cargo.toml with the tag version (so we don't need to create extraneous commits for every preview version)
cp Cargo.toml Cargo2.toml
sed "0,/version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
sed "0,/^version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
working-directory: ${{env.working-directory}}

- uses: actions-rs/toolchain@v1
Expand All @@ -247,7 +249,7 @@ jobs:
run: |
asset_name="pewpew-$VERSION-${{ matrix.wasm-dirctory }}.tar.xz"
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV
XZ_OPT=-9 tar -C ./ -cJf $asset_name package.json config*
XZ_OPT=-9 tar -C ./ -cJf $asset_name package.json ${{ matrix.file-prefix }}*
working-directory: ${{env.working-directory}}/pkg/

- name: Upload release asset
Expand All @@ -263,11 +265,15 @@ jobs:

# The hdr-histogram-wasm and config-gen need to be build with bundler rather than nodejs
wasm-release-histogram:
name: Wasm Pack and Upload Histogram
name: Wasm Pack and Upload Bundler Release
needs: ['create-release']
strategy:
matrix:
wasm-dirctory: [hdr-histogram-wasm, config-gen]
include:
- wasm-dirctory: hdr-histogram-wasm
file-prefix: hdr
- wasm-dirctory: config-gen
file-prefix: config
runs-on: ubuntu-latest
env:
working-directory: ./lib/${{ matrix.wasm-dirctory }}
Expand Down Expand Up @@ -296,7 +302,7 @@ jobs:
version=${VERSION/v/}
# replace the version value in Cargo.toml with the tag version (so we don't need to create extraneous commits for every preview version)
cp Cargo.toml Cargo2.toml
sed "0,/version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
sed "0,/^version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml
working-directory: ${{env.working-directory}}

- uses: actions-rs/toolchain@v1
Expand All @@ -322,7 +328,7 @@ jobs:
run: |
asset_name="pewpew-$VERSION-${{ matrix.wasm-dirctory }}.tar.xz"
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV
XZ_OPT=-9 tar -C ./ -cJf $asset_name package.json hdr*
XZ_OPT=-9 tar -C ./ -cJf $asset_name package.json ${{ matrix.file-prefix }}*
working-directory: ${{env.working-directory}}/pkg/

- name: Upload release asset
Expand Down
Loading

0 comments on commit 778f1c6

Please sign in to comment.