Skip to content

Commit

Permalink
Don't build production binaries in the debug job
Browse files Browse the repository at this point in the history
  • Loading branch information
ark0f committed Mar 20, 2024
1 parent 4880f07 commit 31df668
Show file tree
Hide file tree
Showing 5 changed files with 15 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 @@ -16,6 +16,8 @@ outputs:
description: If enable macOS build.
release:
description: If enable release build.
production:
description: If enable production build.

runs:
using: node20
Expand Down
3 changes: 3 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 [owner, repo] = ["gear-tech", "gear"];

Expand Down Expand Up @@ -78,13 +79,15 @@ 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);

console.log("---");
console.log("build: ", build);
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 @@ -31,6 +31,7 @@ jobs:
win-native: ${{ steps.config.outputs.win-native }}
macos: ${{ steps.config.outputs.macos }}
release: ${{ steps.config.outputs.release }}
production: ${{ steps.config.outputs.production }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -68,3 +69,4 @@ 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' }}
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: ${{ github.event_name == 'push' && inputs.release && inputs.production }}
run: cargo build -p gear-cli -F cli --profile production

- name: Prepare artifacts
if: ${{ github.event_name == 'push' && inputs.release }}
if: ${{ github.event_name == 'push' && inputs.release && inputs.production }}
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' && github.event_name != 'pull_request' && inputs.release && inputs.production }}
uses: actions/upload-artifact@v4
with:
path: artifact
Expand Down

0 comments on commit 31df668

Please sign in to comment.