Skip to content

Commit

Permalink
fix(workflows): Fix release jobs handling of env vars (#3348)
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx authored Sep 24, 2023
1 parent 2a2300c commit 3fc8441
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ jobs:
uses: actions/checkout@v4

- name: "Environment: Cargo path"
run: >
echo "/tmp/cargo/bin" >> $GITHUB_PATH
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH

- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1
Expand All @@ -66,21 +65,19 @@ jobs:
- name: "Environment: Export versions"
run: |
export GEAR_SPEC="$(cat runtime/gear/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')"
export VARA_SPEC="$(cat runtime/vara/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')"
echo "GEAR_SPEC=$(cat runtime/gear/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" >> $GITHUB_ENV
echo "VARA_SPEC=$(cat runtime/vara/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" >> $GITHUB_ENV
- name: "Artifact: Make `artifact` directory"
run: >
mkdir -p artifact
run: mkdir -p artifact

- name: "Build: `wasm-proc`"
run: |
cargo build -p wasm-proc --release
cp -vf target/release/wasm-proc ./
- name: "Build: Production `gear-cli`"
run: >
cargo build -p gear-cli --profile production
run: cargo build -p gear-cli --profile production

- name: "Test: Production runtimes"
run: |
Expand All @@ -89,14 +86,13 @@ jobs:
- name: "Artifact: Production binaries"
run: |
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/gear_v$GEAR_SPEC.wasm"
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_v$VARA_SPEC.wasm"
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/gear_runtime_v$GEAR_SPEC.wasm"
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_runtime_v$VARA_SPEC.wasm"
cp target/production/gear artifact/gear
strip artifact/gear || true
- name: "Build: Development `gear-cli`"
run: >
cargo build -p gear-cli --profile production -F dev
run: cargo build -p gear-cli --profile production -F dev

- name: "Test: Development runtimes"
run: |
Expand All @@ -105,10 +101,8 @@ jobs:
- name: "Artifact: Development binaries"
run: |
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/dev_gear_v$GEAR_SPEC.wasm"
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/dev_vara_v$VARA_SPEC.wasm"
cp target/production/gear artifact/dev-gear
strip artifact/dev-gear || true
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/gear_devruntime_v$GEAR_SPEC.wasm"
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_devruntime_v$VARA_SPEC.wasm"
- name: Publish
uses: softprops/action-gh-release@v1
Expand Down

0 comments on commit 3fc8441

Please sign in to comment.