Skip to content

Commit

Permalink
ci: trigger ecosystem ci and website task from prepare_release_crates
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 6, 2024
1 parent 08fdb26 commit 6a50d13
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/prepare_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write
contents: write

jobs:
prepare_release:
name: Prepare Release Crates
Expand Down
42 changes: 40 additions & 2 deletions .github/workflows/prepare_release_oxlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- prepare-release-oxlint
- trigger-other-workflow

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -13,10 +13,48 @@ concurrency:
permissions:
pull-requests: write
contents: write
actions: write

jobs:
prepare_release:
prepare:
name: Prepare Release Oxlint
uses: ./.github/workflows/reusable_prepare_release.yml
with:
name: oxlint

ecosystem-ci:
needs: prepare
name: Trigger Ecosystem CI
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1

- uses: peter-evans/create-or-update-comment@v4
id: comment
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
body: Triggering Ecosystem CI https://github.com/oxc-project/oxlint-ecosystem-ci/actions/workflows/ecosystem-ci.yml

- uses: benc-uk/workflow-dispatch@v1
with:
repo: oxc-project/oxlint-ecosystem-ci
workflow: ecosystem-ci.yml
token: ${{ secrets.PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment.outputs.comment-id }}" }'

website:
needs: prepare
name: Update oxc.rs
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1

- uses: benc-uk/workflow-dispatch@v1
with:
repo: oxc-project/oxc-project.github.io
workflow: release.yml
token: ${{ secrets.PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "version": "${{ needs.prepare.outputs.version }}" }'
17 changes: 16 additions & 1 deletion .github/workflows/reusable_prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,28 @@ on:
required: true
type: string
description: "The name defined in oxc_release.toml"
outputs:
pull-request-number:
value: ${{ jobs.run.outputs.pull-request-number }}
version:
value: ${{ jobs.run.outputs.version }}

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-D warnings"

permissions:
pull-requests: write
contents: write
actions: write

jobs:
run:
name: Prepare Release Crates
name: Prepare Release
runs-on: ubuntu-latest
outputs:
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
version: ${{ steps.version.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -59,13 +72,15 @@ jobs:
- run: cargo check

- uses: peter-evans/create-pull-request@v6
id: pr
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Release ${{ inputs.name }}
committer: Boshen <Boshen@users.noreply.github.com>
author: Boshen <Boshen@users.noreply.github.com>
branch: release/${{ inputs.name }}
branch-suffix: timestamp
base: main
title: Release ${{ inputs.name }} v${{ steps.version.outputs.VERSION }}
body: ${{ steps.changelog.outputs.CHANGELOG }}
assignees: Boshen

0 comments on commit 6a50d13

Please sign in to comment.