Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): use new release workflow #592

Merged
merged 6 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 0 additions & 87 deletions .github/workflows/bench-pr.yml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
name: Lint

# Controls when the action will run.
on:
# Triggers the workflow on pull request events but only for the main branch
pull_request:
branches: [main]

push:
branches: [main]

merge_group:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -30,7 +22,7 @@ jobs:
- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/release-pull-request.yml

This file was deleted.

34 changes: 15 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ name: Release
on:
workflow_dispatch:
inputs:
version:
npm_tag:
type: choice
description: 'Release Version (next, beta, alpha, latest)'
description: 'Specify npm tag'
required: true
default: 'next'
default: 'alpha'
options:
- next
- beta
- alpha
- beta
- rc
- canary
- latest
branch:
description: 'Release Branch (confirm release branch)'
description: 'Branch to release'
required: true
default: 'main'

Expand All @@ -26,17 +27,18 @@ jobs:
name: Release
if: github.repository == 'web-infra-dev/rslib' && github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 25
fetch-depth: 1
ref: ${{ github.event.inputs.branch }}

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
Expand All @@ -45,15 +47,9 @@ jobs:
- name: Install Dependencies
run: pnpm install

- name: Release
uses: web-infra-dev/actions@v2
with:
version: ${{ github.event.inputs.version }}
branch: ${{ github.event.inputs.branch }}
type: 'release'
tools: 'changeset'
- name: Publish to npm
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
NPM_TOKEN: ${{ secrets.RSLIB_NPM_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
pnpm -r publish --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }}
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
name: Test

# Controls when the action will run.
on:
# Triggers the workflow on pull request events but only for the main branch
pull_request:
branches: [main]

push:
branches: [main]

merge_group:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# ======== calculate changes ========
changes:
Expand All @@ -25,7 +19,6 @@ jobs:
matrix:
node-version: [18]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -35,7 +28,7 @@ jobs:
- name: Install Pnpm
run: corepack enable

- uses: dorny/paths-filter@v3
- uses: dorny/paths-filter@v3.0.2
id: changes
with:
predicate-quantifier: 'every'
Expand All @@ -59,7 +52,6 @@ jobs:
- node-version: 18
os: windows-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -100,7 +92,6 @@ jobs:
- node-version: 18
os: windows-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Git config
if: ${{ matrix.os == 'windows-latest' }}
Expand Down Expand Up @@ -141,7 +132,6 @@ jobs:
matrix:
node-version: [20]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
Loading