Skip to content

Commit

Permalink
fix(ci): Don't build production binaries in the debug job (#3823)
Browse files Browse the repository at this point in the history
  • Loading branch information
ark0f authored and gshep committed Mar 25, 2024
1 parent a1656d2 commit 4289360
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/actions/message/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ outputs:
description: If enable validator checks.
release:
description: If enable release build.
production:
description: If enable production build.

runs:
using: node20
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/message/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const DEPBOT = "[depbot]";
const WINDOWS_NATIVE = "E1-forcenatwin";
const MACOS = "E2-forcemacos";
const RELEASE = "E3-forcerelease";
const PRODUCTION = "E4-forceproduction";
const SKIP_CI = "[skip-ci]";
const VALIDATOR_LABEL = "check-validator";
const [owner, repo] = ["gear-tech", "gear"];
Expand Down Expand Up @@ -80,20 +81,23 @@ async function main() {
const win_native = !skipCI && labels.includes(WINDOWS_NATIVE);
const macos = !skipCI && labels.includes(MACOS);
const release = !skipCI && labels.includes(RELEASE);
const production = !skipCI && labels.includes(PRODUCTION);

// Set outputs
core.setOutput("build", build);
core.setOutput("check", !skipCI);
core.setOutput("win-native", win_native);
core.setOutput("macos", macos);
core.setOutput("release", release);
core.setOutput("production", production);
core.setOutput("validator", !skipCI);

console.log("---");
console.log("build: ", build);
console.log("check: ", !skipCI);
console.log("native windows: ", win_native);
console.log("macos: ", macos);
console.log("production: ", production);
console.log("validator: ", validator);
console.log("release: ", release);

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
macos: true
win-native: true
release: true

production: true
upload:
if: github.event_name == 'push' && github.ref_name == 'master'
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR

on:
pull_request:
branches: [master]
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -32,6 +32,7 @@ jobs:
macos: ${{ steps.config.outputs.macos }}
validator: ${{ steps.config.outputs.validator }}
release: ${{ steps.config.outputs.release }}
production: ${{ steps.config.outputs.production }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -69,6 +70,7 @@ jobs:
macos: ${{ needs.status.outputs.macos == 'true' }}
win-native: ${{ needs.status.outputs.win-native == 'true' }}
release: ${{ needs.status.outputs.release == 'true' }}
production: ${{ needs.status.outputs.production == 'true' }}

validator:
needs: status
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
release:
type: boolean
default: false
production:
type: boolean
default: false
workflow_dispatch:
inputs:
title:
Expand Down Expand Up @@ -137,11 +140,11 @@ jobs:
RUST_LOG: info

- name: "Build: Production binaries"
if: ${{ github.event_name == 'push' && inputs.release }}
if: ${{ inputs.production && matrix.profile == 'release' }}
run: cargo build -p gear-cli -F cli --profile production

- name: Prepare artifacts
if: ${{ github.event_name == 'push' && inputs.release }}
if: ${{ inputs.production && matrix.profile == 'release' }}
run: |
mkdir -p artifact
cd target/wasm32-unknown-unknown/release
Expand All @@ -156,7 +159,7 @@ jobs:
strip artifact/wasm-proc || true
- name: Upload artifacts
if: ${{ github.event_name == 'push' && inputs.release }}
if: ${{ github.event_name == 'push' && inputs.production && matrix.profile == 'release' }}
uses: actions/upload-artifact@v4
with:
path: artifact
Expand Down

0 comments on commit 4289360

Please sign in to comment.