Skip to content

Commit 2dcbad4

Browse files
fix(ci): use org actions
1 parent cf36b08 commit 2dcbad4

File tree

2 files changed

+72
-46
lines changed

2 files changed

+72
-46
lines changed

.github/workflows/release.yml

Lines changed: 69 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Manual NPM Publish
1+
name: Release Eslint Stencil
22

33
on:
44
workflow_dispatch:
@@ -12,50 +12,77 @@ on:
1212
- patch
1313
- minor
1414
- major
15-
distTag:
16-
description: 'NPM tag (e.g. use "next" to release a test version)'
15+
devRelease:
16+
description: Set to "yes" to release a dev build
1717
required: true
18-
default: 'latest'
19-
20-
env:
21-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22-
NPM_CONFIG_PROVENANCE: true
18+
type: choice
19+
default: "no"
20+
options:
21+
- "yes"
22+
- "no"
2323

2424
jobs:
25-
release:
25+
build:
26+
name: Build
27+
uses: stenciljs/.github/workflows/build.yml@main
28+
29+
get_dev_version:
30+
if: inputs.devRelease == 'yes'
31+
name: Get Dev Build Version
32+
runs-on: ubuntu-latest
33+
outputs:
34+
dev-version: ${{ steps.generate-dev-version.outputs.DEV_VERSION }}
35+
steps:
36+
- name: Checkout Code
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
39+
- name: Generate Dev Version
40+
id: generate-dev-version
41+
run: |
42+
PKG_JSON_VERSION=$(cat package.json | jq -r '.version')
43+
GIT_HASH=$(git rev-parse --short HEAD)
44+
45+
# A unique string to publish Stencil Sass under
46+
# e.g. "2.1.0-dev.1677185104.7c87e34"
47+
DEV_VERSION=$PKG_JSON_VERSION-dev.$(date +"%s").$GIT_HASH
48+
49+
echo "Using version $DEV_VERSION"
50+
51+
# store a key/value pair in GITHUB_OUTPUT
52+
# e.g. "DEV_VERSION=2.1.0-dev.1677185104.7c87e34"
53+
echo "DEV_VERSION=$DEV_VERSION" >> $GITHUB_OUTPUT
54+
shell: bash
55+
56+
release_sass_stencil:
57+
if: inputs.devRelease == 'yes'
58+
name: Publish Dev Build
59+
needs: [build, get_dev_version]
60+
runs-on: ubuntu-latest
61+
permissions:
62+
id-token: write
63+
steps:
64+
- name: Checkout Code
65+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
66+
- uses: stenciljs/.github/actions/publish-npm@main
67+
with:
68+
tag: dev
69+
version: ${{ needs.get_dev_version.outputs.dev-version }}
70+
token: ${{ secrets.NPM_PAT_STENCIL_BOT }}
71+
72+
release_create_stencil_cli:
73+
if: inputs.devRelease == 'no'
74+
name: Publish Eslint Stencil
75+
needs: [build]
2676
runs-on: ubuntu-latest
2777
permissions:
28-
contents: write
29-
id-token: write
78+
contents: write
79+
id-token: write
3080
steps:
31-
- name: ⬇️ Checkout Code
32-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33-
34-
- name: 🐢 Setup Node
35-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
36-
with:
37-
node-version-file: '.nvmrc'
38-
cache: 'npm'
39-
40-
- name: 📦 NPM Setup
41-
run: |
42-
npm set registry "https://registry.npmjs.org/"
43-
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
44-
npm whoami
45-
46-
- name: 📁 Git Setup
47-
run: |
48-
git config --global user.name github-actions
49-
git config --global user.email [email protected]
50-
51-
- name: 🏗️ Install Dependencies
52-
run: npm ci
53-
54-
- name: 👷 Build
55-
run: npm run build
56-
57-
- name: 📢 Release
58-
run: npx release-it ${{github.event.inputs.releaseType}} --github.release --ci --npm.skipChecks --no-git.requireCleanWorkingDir --npm.tag=${{github.event.inputs.distTag}}
59-
env:
60-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
- name: Checkout Code
82+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83+
- uses: stenciljs/.github/actions/publish-npm@main
84+
with:
85+
tag: latest
86+
version: ${{ inputs.releaseType }}
87+
token: ${{ secrets.NPM_PAT_STENCIL_BOT }}
88+
github-token: ${{ secrets.GH_ADMIN_PAT }}

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"Tom Chinery <[email protected]>",
1515
"Jack Woodward <[email protected]>",
1616
"Ionic Team <[email protected]>",
17-
"d0whc3r <[email protected]>"
17+
"d0whc3r <[email protected]>",
18+
"Christian Bromann <[email protected]>"
1819
],
1920
"type": "module",
2021
"main": "dist/index.js",
@@ -25,8 +26,7 @@
2526
"scripts": {
2627
"build": "rollup -c",
2728
"test": "vitest --run",
28-
"version": "npm run build",
29-
"release": "np --no-release-draft"
29+
"version": "npm run build"
3030
},
3131
"dependencies": {
3232
"eslint-utils": "^3.0.0",
@@ -53,7 +53,6 @@
5353
"@vitest/coverage-v8": "^3.0.7",
5454
"eslint": "^9.21.0",
5555
"eslint-plugin-react": "^7.37.4",
56-
"np": "^10.2.0",
5756
"rollup": "^4.34.8",
5857
"typescript": "^5.7.3",
5958
"vitest": "^3.0.7"

0 commit comments

Comments
 (0)