Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): Don't build production binaries in the debug job #3823

Merged
merged 4 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading