Ionic/.github/workflows/release.yml

71 lines
2.1 KiB
YAML

name: 'Ionic Production Release'
on:
workflow_dispatch:
inputs:
version:
required: true
type: choice
description: Which version should be published?
options:
- patch
- minor
- major
tag:
required: true
type: choice
description: Which npm tag should this be published to?
options:
- latest
- v5-lts
- v4-lts
jobs:
build-ionic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.IONITRON_TOKEN }}
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Configure Identity
run: |
git config user.name github-actions
git config user.email github-actions@github.com
shell: bash
- name: Install Dependencies
run: npm ci --no-package-lock && lerna bootstrap --ignore-scripts -- --legacy-peer-deps
shell: bash
- name: Prepare NPM Token
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
shell: bash
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release
run: |
HUSKY_SKIP_HOOKS=1 lerna publish $(echo "${{ github.event.inputs.version }}") --no-verify-access --yes --force-publish='*' --dist-tag $(echo "${{ github.event.inputs.tag }}") --conventional-commits --create-release github
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
# Purge the JSDeliver CDN cache so
# component playgrounds always load
# the latest version of Ionic.
- name: Purge JSDelivr Cache
run: |
curl -X POST \
https://purge.jsdelivr.net/ \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"path": [
"/npm/@ionic/core@6/dist/ionic/ionic.esm.js",
"/npm/@ionic/core@latest/dist/ionic/ionic.esm.js",
"/npm/@ionic/core@6/css/ionic.bundle.css",
"/npm/@ionic/core@latest/css/ionic.bundle.css"
]}'