mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Calculate tag for releases based on package.json version (#9572)
* calculate tag for the release This is based on the name we use in the version e.g.: `3.2.0-beta.2`. If no name can be found in the version, we will default to `latest` * ignore node_modules caching for now
This commit is contained in:
parent
855fa300a0
commit
c2854dae71
22
.github/workflows/integration-tests.yml
vendored
22
.github/workflows/integration-tests.yml
vendored
@ -33,19 +33,19 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'npm'
|
||||
|
||||
- name: Use cached node_modules (tailwindcss)
|
||||
id: cache-tailwindcss
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: node_modules
|
||||
key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}-tailwindcss
|
||||
restore-keys: |
|
||||
nodeModules-
|
||||
# cache: 'npm'
|
||||
#
|
||||
# - name: Use cached node_modules (tailwindcss)
|
||||
# id: cache-tailwindcss
|
||||
# uses: actions/cache@v3
|
||||
# with:
|
||||
# path: node_modules
|
||||
# key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}-tailwindcss
|
||||
# restore-keys: |
|
||||
# nodeModules-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-tailwindcss.outputs.cache-hit != 'true'
|
||||
# if: steps.cache-tailwindcss.outputs.cache-hit != 'true'
|
||||
run: npm install
|
||||
env:
|
||||
CI: true
|
||||
|
||||
4
.github/workflows/nodejs.yml
vendored
4
.github/workflows/nodejs.yml
vendored
@ -26,8 +26,8 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
# cache: 'npm'
|
||||
|
||||
# cache: 'npm'
|
||||
#
|
||||
# - name: Use cached node_modules
|
||||
# id: cache
|
||||
# uses: actions/cache@v3
|
||||
|
||||
4
.github/workflows/release-insiders.yml
vendored
4
.github/workflows/release-insiders.yml
vendored
@ -23,8 +23,8 @@ jobs:
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
# cache: 'npm'
|
||||
|
||||
# cache: 'npm'
|
||||
#
|
||||
# - name: Use cached node_modules
|
||||
# id: cache
|
||||
# uses: actions/cache@v3
|
||||
|
||||
28
.github/workflows/release.yml
vendored
28
.github/workflows/release.yml
vendored
@ -23,19 +23,19 @@ jobs:
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Use cached node_modules
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: node_modules
|
||||
key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
|
||||
restore-keys: |
|
||||
nodeModules-
|
||||
# cache: 'npm'
|
||||
#
|
||||
# - name: Use cached node_modules
|
||||
# id: cache
|
||||
# uses: actions/cache@v3
|
||||
# with:
|
||||
# path: node_modules
|
||||
# key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
|
||||
# restore-keys: |
|
||||
# nodeModules-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
# if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: npm install
|
||||
env:
|
||||
CI: true
|
||||
@ -45,8 +45,12 @@ jobs:
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Calculate tag
|
||||
run: |
|
||||
echo "tag_name=$(npm run calculate-tag-name --silent)" >> $GITHUB_ENV
|
||||
|
||||
- name: Publish
|
||||
run: npm publish
|
||||
run: npm publish --tag ${{ env.tag_name }}
|
||||
env:
|
||||
CI: true
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
@ -26,7 +26,8 @@
|
||||
"posttest": "npm run style",
|
||||
"generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js",
|
||||
"generate:types": "node -r @swc/register scripts/generate-types.js",
|
||||
"generate": "npm run generate:plugin-list && npm run generate:types"
|
||||
"generate": "npm run generate:plugin-list && npm run generate:types",
|
||||
"calculate-tag-name": "node scripts/calculate-tag-name.js"
|
||||
},
|
||||
"files": [
|
||||
"src/*",
|
||||
|
||||
8
scripts/calculate-tag-name.js
Normal file
8
scripts/calculate-tag-name.js
Normal file
@ -0,0 +1,8 @@
|
||||
let version = process.env.npm_package_version || require('../package.json').version
|
||||
|
||||
let match = /\d+\.\d+\.\d+-(.*)\.\d+/g.exec(version)
|
||||
if (match) {
|
||||
console.log(match[1])
|
||||
} else {
|
||||
console.log('latest')
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user