Skip to content

Commit

Permalink
ci(label): use fork-action instead of action script (#3764)
Browse files Browse the repository at this point in the history
  • Loading branch information
clearloop authored May 28, 2024
1 parent a1977c2 commit 716700d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 220 deletions.
206 changes: 0 additions & 206 deletions .github/actions/label/build.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/message/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function main() {
const {
pull_request: {
title,
head: { sha, ref: branch },
head: { sha },
labels: _labels,
},
repository: { full_name: fullName },
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
type: string
required: true
workflow_dispatch:
inputs:
profiles:
type: string
default: '[{ "name": "debug", "flags": "" }]'

env:
CARGO_TERM_COLOR: always
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-win-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
type: string
required: true
workflow_dispatch:
inputs:
profiles:
type: string
default: '[{ "name": "debug", "flags": "" }]'

env:
CARGO_TERM_COLOR: always
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ on:
number:
type: string
description: "Pull request number that triggers this workflow"
release:
type: boolean
default: false
production:
type: boolean
default: false

run-name: ${{ inputs.title }} ( ${{ format('#{0}', inputs.number) }} )

Expand Down
51 changes: 38 additions & 13 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,47 @@ jobs:
runs-on: ubuntu-latest
if: >-
github.event.label.name == 'A0-pleasereview'
|| github.event.label.name == 'E2-forcemacos'
|| github.event.label.name == 'A4-insubstantial'
|| github.event.label.name == 'A2-mergeoncegreen'
|| github.event.label.name == 'E1-forcenatwin'
|| github.event.label.name == 'E2-forcemacos'
steps:
- uses: actions/checkout@v4

- name: Fork Linux checks
if: >-
github.event.label.name == 'A0-pleasereview'
|| github.event.label.name == 'A4-insubstantial'
|| github.event.label.name == 'A2-mergeoncegreen'
uses: gear-tech/fork-action@main
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/github-script@v7
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
LABEL: ${{ github.event.label.name }}
REF: ${{ github.head_ref || github.ref_name }}
TITLE: ${{ github.event.pull_request.title }}
NUMBER: ${{ github.event.number }}
REPO: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.GITHUB_TOKEN }}
workflow_id: ".github/workflows/build.yml"
prefix: "build"
jobs: '["linux", "win-cross"]'
useMulti: true
inputs: '{
"title": "${{ github.event.pull_request.title }}",
"number": "${{ github.event.number }}"
}'

- name: Fork OSX checks
if: github.event.label.name == 'E2-forcemacos'
uses: gear-tech/fork-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
workflow_id: ".github/workflows/build-macos.yml"
prefix: "build"
jobs: '[ "macos-x86", "macos-aarch64" ]'
useProfiles: true

- name: Fork Win checks
if: github.event.label.name == 'E1-forcenatwin'
uses: gear-tech/fork-action@main
with:
script: |
const script = require('./.github/actions/label/build.js');
await script({ github, core });
token: ${{ secrets.GITHUB_TOKEN }}
workflow_id: ".github/workflows/build-win-native.yml"
prefix: "build"
jobs: '[ "win-native" ]'
useProfiles: true

0 comments on commit 716700d

Please sign in to comment.