Skip to content

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
ark0f committed Dec 17, 2023
2 parents df03809 + f6c13bd commit 2384b97
Show file tree
Hide file tree
Showing 116 changed files with 3,040 additions and 1,947 deletions.
11 changes: 8 additions & 3 deletions .github/actions/label/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

const [owner, repo] = ["gear-tech", "gear"];
const { LABEL, REF, HEAD_SHA, TITLE, NUMBER } = process.env;
const { LABEL, REF, HEAD_SHA, TITLE, NUMBER, IS_FORK, REF_NAME } = process.env;
const linux =
LABEL === "A0-pleasereview" ||
LABEL === "A4-insubstantial" ||
Expand All @@ -20,8 +20,12 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));

/**
* If skipping this action.
*
* @returns {Promise<[boolean, string]>} [skip, String(check_runs)]
**/
const skip = async ({ core, github }) => {
const skip = async ({ github }) => {
if (!IS_FORK && REF_NAME.startsWith("dependabot")) return [true, ""]

const {
data: { check_runs },
} = await github.rest.checks.listForRef({
Expand Down Expand Up @@ -142,7 +146,8 @@ const listJobs = async ({ github, core, run_id }) => {
* The main function.
**/
module.exports = async ({ github, core }) => {
const [skipAction, check_runs] = await skip({ core, github });
const [skipAction, check_runs] = await skip({ github });

if (skipAction) {
core.info("Build has already been processed, check runs: " + check_runs);
return;
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ jobs:
if: >-
needs.status.outputs.skip-ci != '1'
&& (
contains(github.event.pull_request.title, '[depbot]')
|| (
(
github.event.pull_request.head.repo.full_name == 'gear-tech/gear'
&& contains(github.event.pull_request.title, '[depbot]')
) || (
contains(github.event.pull_request.labels.*.name, 'A0-pleasereview')
|| contains(github.event.pull_request.labels.*.name, 'A4-insubstantial')
|| contains(github.event.pull_request.labels.*.name, 'A2-mergeoncegreen')
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/crates-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ name: Crates IO

on:
workflow_dispatch:
inputs:
publish:
description: "If publish packages"
type: boolean
default: false
version:
description: "Workspace version to publish"
type: string
pull_request:
branches: [master]

env:
CARGO_INCREMENTAL: 0
Expand All @@ -10,7 +20,7 @@ env:
TERM: xterm-256color

jobs:
publish:
check:
runs-on: ubuntu-latest
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand All @@ -21,5 +31,9 @@ jobs:
- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1

- name: "Check packages"
run: cargo run --release -p crates-io check

- name: "Publish packages"
run: cargo run --release -p crates-io-manager
if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish }}
run: cargo run --release -p crates-io publish -v ${{ inputs.version }}
2 changes: 2 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ jobs:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
LABEL: ${{ github.event.label.name }}
REF: ${{ github.head_ref || github.ref_name }}
REF_NAME: ${{ github.ref_name }}
TITLE: ${{ github.event.pull_request.title }}
NUMBER: ${{ github.event.number }}
IS_FORK: ${{ github.event.pull_request.head.repo.full_name != 'gear-tech/gear' }}
with:
script: |
const script = require('./.github/actions/label/build.js');
Expand Down
Loading

0 comments on commit 2384b97

Please sign in to comment.