diff --git a/.github/actions/message/action.yml b/.github/actions/message/action.yml index 814b344db3d..49a58966d8a 100644 --- a/.github/actions/message/action.yml +++ b/.github/actions/message/action.yml @@ -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 diff --git a/.github/actions/message/main.js b/.github/actions/message/main.js index c7fab13daab..a65b38cd634 100644 --- a/.github/actions/message/main.js +++ b/.github/actions/message/main.js @@ -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"]; @@ -80,6 +81,7 @@ 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); @@ -87,6 +89,7 @@ async function main() { core.setOutput("win-native", win_native); core.setOutput("macos", macos); core.setOutput("release", release); + core.setOutput("production", production); core.setOutput("validator", !skipCI); console.log("---"); @@ -94,6 +97,7 @@ async function main() { 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); diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 72148f84e2d..37d90b31545 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -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 diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index fe6c3a62845..6a2b98aa0a2 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -2,7 +2,7 @@ name: PR on: pull_request: - branches: [master] + branches: [ master ] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -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: @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be9690f1b31..44a356dee89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ on: release: type: boolean default: false + production: + type: boolean + default: false workflow_dispatch: inputs: title: @@ -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 @@ -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