Prepare for release (#9605)
* rename `build-cli.yml` to `prepare-release.yml` In other repo's we will also have a `prepare-release` so this makes it a bit more consistent. * use common CONSTANT_CASE for environment variables * use `strategy` for defining the node version * add script to get the release notes * add release notes to release draft * use CONSTANT_CASE for environment variables * improve consistency for relase related scripts
This commit is contained in:
parent
ddb9b4d7bc
commit
cb6e45a3bc
7 changed files with 77 additions and 30 deletions
|
|
@ -1,4 +1,4 @@
|
|||
name: Build Standalone CLI
|
||||
name: Prepare Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
|
@ -13,10 +13,16 @@ permissions:
|
|||
contents: read
|
||||
|
||||
jobs:
|
||||
build_cli:
|
||||
build:
|
||||
permissions:
|
||||
contents: write # for softprops/action-gh-release to create GitHub release
|
||||
|
||||
runs-on: macos-11
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
@ -25,12 +31,19 @@ jobs:
|
|||
- name: Resolve version
|
||||
id: vars
|
||||
run: |
|
||||
echo "tag_name=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
||||
echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
||||
|
||||
- name: Use Node.js 16
|
||||
- name: Get release notes
|
||||
run: |
|
||||
RELEASE_NOTES=$(npm run release-notes --silent)
|
||||
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
|
||||
echo "$RELEASE_NOTES" >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: ${{ matrix.node-version }}
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Build tailwindcss
|
||||
|
|
@ -52,14 +65,16 @@ jobs:
|
|||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
tag_name: ${{ env.tag_name }}
|
||||
tag_name: ${{ env.TAG_NAME }}
|
||||
body: |
|
||||
* [Linux (arm64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.tag_name }}/tailwindcss-linux-arm64)
|
||||
* [Linux (armv7)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.tag_name }}/tailwindcss-linux-armv7)
|
||||
* [Linux (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.tag_name }}/tailwindcss-linux-x64)
|
||||
* [macOS (arm64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.tag_name }}/tailwindcss-macos-arm64)
|
||||
* [macOS (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.tag_name }}/tailwindcss-macos-x64)
|
||||
* [Windows (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.tag_name }}/tailwindcss-windows-x64.exe)
|
||||
${{ env.RELEASE_NOTES }}
|
||||
|
||||
* [Linux (arm64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-linux-arm64)
|
||||
* [Linux (armv7)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-linux-armv7)
|
||||
* [Linux (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-linux-x64)
|
||||
* [macOS (arm64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-macos-arm64)
|
||||
* [macOS (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-macos-x64)
|
||||
* [Windows (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-windows-x64.exe)
|
||||
files: |
|
||||
standalone-cli/dist/tailwindcss-linux-arm64
|
||||
standalone-cli/dist/tailwindcss-linux-armv7
|
||||
8
.github/workflows/release-insiders.yml
vendored
8
.github/workflows/release-insiders.yml
vendored
|
|
@ -61,10 +61,10 @@ jobs:
|
|||
- name: Resolve version
|
||||
id: vars
|
||||
run: |
|
||||
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
|
||||
- name: 'Version based on commit: 0.0.0-insiders.${{ env.sha_short }}'
|
||||
run: npm version 0.0.0-insiders.${{ env.sha_short }} --force --no-git-tag-version
|
||||
- name: 'Version based on commit: 0.0.0-insiders.${{ env.SHA_SHORT }}'
|
||||
run: npm version 0.0.0-insiders.${{ env.SHA_SHORT }} --force --no-git-tag-version
|
||||
|
||||
- name: Publish
|
||||
run: npm publish --tag insiders
|
||||
|
|
@ -83,6 +83,6 @@ jobs:
|
|||
ref: 'master',
|
||||
workflow_id: 'upgrade-tailwindcss.yml',
|
||||
inputs: {
|
||||
insidersVersion: '0.0.0-insiders.${{ env.sha_short }}'
|
||||
insidersVersion: '0.0.0-insiders.${{ env.SHA_SHORT }}'
|
||||
}
|
||||
})
|
||||
|
|
|
|||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
|
|
@ -47,17 +47,17 @@ jobs:
|
|||
|
||||
- name: Calculate environment variables
|
||||
run: |
|
||||
echo "tag_name=$(npm run calculate-tag-name --silent)" >> $GITHUB_ENV
|
||||
echo "tailwindcss_version=$(node -e 'console.log(require(`./package.json`).version);')" >> $GITHUB_ENV
|
||||
echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV
|
||||
echo "TAILWINDCSS_VERSION=$(node -e 'console.log(require(`./package.json`).version);')" >> $GITHUB_ENV
|
||||
|
||||
- name: Publish
|
||||
run: npm publish --tag ${{ env.tag_name }}
|
||||
run: npm publish --tag ${{ env.RELEASE_CHANNEL }}
|
||||
env:
|
||||
CI: true
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Trigger Tailwind Play update
|
||||
if: env.tag_name == 'latest'
|
||||
if: env.RELEASE_CHANNEL == 'latest'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.TAILWIND_PLAY_TOKEN }}
|
||||
|
|
@ -68,6 +68,6 @@ jobs:
|
|||
ref: 'master',
|
||||
workflow_id: 'upgrade-tailwindcss.yml',
|
||||
inputs: {
|
||||
version: '${{ env.tailwindcss_version }}'
|
||||
version: '${{ env.TAILWINDCSS_VERSION }}'
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue