chore(ci): release workflows now use reusable workflow (#26304)

This commit is contained in:
Liam DeBeasi
2022-11-17 11:20:15 -05:00
committed by GitHub
parent 842573477b
commit d7b86d7625
5 changed files with 220 additions and 531 deletions

View File

@ -21,188 +21,20 @@ jobs:
run: |
echo "DEV_HASH=$(node ./.scripts/bump-version.js)-dev.1$(date +%s).1$(git log -1 --format=%H | cut -c 1-7)" >> $GITHUB_OUTPUT
shell: bash
release-core:
runs-on: ubuntu-latest
release-ionic:
needs: [create-dev-hash]
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/core'
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: 'core'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/core
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-core
output: core/CoreBuild.zip
paths: core/dist core/components core/css core/hydrate core/loader core/src/components.d.ts
- name: Cache Built @ionic/docs
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-docs
output: docs/DocsBuild.zip
paths: docs/core.json docs/core.d.ts
release-docs:
needs: [create-dev-hash, release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/docs built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-docs
path: ./docs
filename: DocsBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/docs'
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: 'docs'
token: ${{ secrets.NPM_TOKEN }}
release-angular:
needs: [create-dev-hash, release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/angular'
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: 'angular'
folder: './dist'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/angular
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-angular
output: ./angular/AngularBuild.zip
paths: ./angular/dist
release-react:
needs: [create-dev-hash, release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/react'
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: 'packages/react'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/react
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-react
output: packages/react/ReactBuild.zip
paths: packages/react/dist packages/react/css
release-vue:
needs: [create-dev-hash, release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/vue'
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: 'packages/vue'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/vue
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-vue
output: packages/vue/VueBuild.zip
paths: packages/vue/dist packages/vue/css
release-angular-server:
needs: [create-dev-hash, release-angular]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/angular built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-angular
path: ./angular
filename: AngularBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/angular-server'
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: 'packages/angular-server'
folder: './dist'
token: ${{ secrets.NPM_TOKEN }}
release-react-router:
needs: [create-dev-hash, release-react]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/react built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-react
path: ./packages/react
filename: ReactBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/react-router'
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: 'packages/react-router'
token: ${{ secrets.NPM_TOKEN }}
release-vue-router:
needs: [create-dev-hash, release-vue]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/vue built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-vue
path: ./packages/vue
filename: VueBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/vue-router'
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: 'packages/vue-router'
token: ${{ secrets.NPM_TOKEN }}
uses: ./.github/workflows/release-ionic.yml
with:
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
get-build:
name: Get your dev build!
runs-on: ubuntu-latest
needs: [create-dev-hash, release-core, release-angular, release-react, release-vue, release-docs, release-angular-server, release-vue-router, release-react-router]
needs: [create-dev-hash, release-ionic]
steps:
- run: echo ${{ needs.create-dev-hash.outputs.dev-hash }}

View File

@ -26,186 +26,18 @@ jobs:
run: |
echo "NIGHTLY_HASH=$(node ./.scripts/bump-version.js)-nightly.$(date +%Y%m%d)" >> $GITHUB_OUTPUT
shell: bash
release-core:
runs-on: ubuntu-latest
release-ionic:
needs: [create-nightly-hash]
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/core'
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
working-directory: 'core'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/core
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-core
output: core/CoreBuild.zip
paths: core/dist core/components core/css core/hydrate core/loader core/src/components.d.ts
- name: Cache Built @ionic/docs
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-docs
output: docs/DocsBuild.zip
paths: docs/core.json docs/core.d.ts
release-docs:
needs: [create-nightly-hash, release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/docs built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-docs
path: ./docs
filename: DocsBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/docs'
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
working-directory: 'docs'
token: ${{ secrets.NPM_TOKEN }}
release-angular:
needs: [create-nightly-hash, release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/angular'
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
working-directory: 'angular'
folder: './dist'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/angular
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-angular
output: ./angular/AngularBuild.zip
paths: ./angular/dist
release-react:
needs: [create-nightly-hash, release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/react'
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
working-directory: 'packages/react'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/react
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-react
output: packages/react/ReactBuild.zip
paths: packages/react/dist packages/react/css
release-vue:
needs: [create-nightly-hash, release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/vue'
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
working-directory: 'packages/vue'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/vue
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-vue
output: packages/vue/VueBuild.zip
paths: packages/vue/dist packages/vue/css
release-angular-server:
needs: [create-nightly-hash, release-angular]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/angular built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-angular
path: ./angular
filename: AngularBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/angular-server'
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
working-directory: 'packages/angular-server'
folder: './dist'
token: ${{ secrets.NPM_TOKEN }}
release-react-router:
needs: [create-nightly-hash, release-react]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/react built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-react
path: ./packages/react
filename: ReactBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/react-router'
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
working-directory: 'packages/react-router'
token: ${{ secrets.NPM_TOKEN }}
release-vue-router:
needs: [create-nightly-hash, release-vue]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/vue built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-vue
path: ./packages/vue
filename: VueBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/vue-router'
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
working-directory: 'packages/vue-router'
token: ${{ secrets.NPM_TOKEN }}
uses: ./.github/workflows/release-ionic.yml
with:
tag: nightly
version: ${{ needs.create-nightly-hash.outputs.nightly-hash }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
finalize-release:
needs: [create-nightly-hash, release-core, release-angular, release-react, release-vue, release-docs, release-angular-server, release-vue-router, release-react-router]
needs: [create-nightly-hash, release-ionic]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

194
.github/workflows/release-ionic.yml vendored Normal file
View File

@ -0,0 +1,194 @@
name: 'Release Ionic'
on:
workflow_call:
inputs:
version:
description: 'The type of version to release.'
type: string
required: true
tag:
description: 'The tag to publish to on NPM.'
type: string
required: true
secrets:
NPM_TOKEN:
required: true
jobs:
release-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/publish-npm
with:
scope: '@ionic/core'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'core'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/core
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-core
output: core/CoreBuild.zip
paths: core/dist core/components core/css core/hydrate core/loader core/src/components.d.ts
- name: Cache Built @ionic/docs
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-docs
output: docs/DocsBuild.zip
paths: docs/core.json docs/core.d.ts
release-docs:
needs: [release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/docs built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-docs
path: ./docs
filename: DocsBuild.zip
- uses: ./.github/workflows/actions/publish-npm
with:
scope: '@ionic/docs'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'docs'
token: ${{ secrets.NPM_TOKEN }}
release-angular:
needs: [release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/publish-npm
with:
scope: '@ionic/angular'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'angular'
folder: './dist'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/angular
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-angular
output: ./angular/AngularBuild.zip
paths: ./angular/dist
release-react:
needs: [release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/publish-npm
with:
scope: '@ionic/react'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/react'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/react
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-react
output: packages/react/ReactBuild.zip
paths: packages/react/dist packages/react/css
release-vue:
needs: [release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/publish-npm
with:
scope: '@ionic/vue'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/vue'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/vue
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-vue
output: packages/vue/VueBuild.zip
paths: packages/vue/dist packages/vue/css
release-angular-server:
needs: [release-angular]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/angular built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-angular
path: ./angular
filename: AngularBuild.zip
- uses: ./.github/workflows/actions/publish-npm
with:
scope: '@ionic/angular-server'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/angular-server'
folder: './dist'
token: ${{ secrets.NPM_TOKEN }}
release-react-router:
needs: [release-react]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/react built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-react
path: ./packages/react
filename: ReactBuild.zip
- uses: ./.github/workflows/actions/publish-npm
with:
scope: '@ionic/react-router'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/react-router'
token: ${{ secrets.NPM_TOKEN }}
release-vue-router:
needs: [release-vue]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/vue built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-vue
path: ./packages/vue
filename: VueBuild.zip
- uses: ./.github/workflows/actions/publish-npm
with:
scope: '@ionic/vue-router'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/vue-router'
token: ${{ secrets.NPM_TOKEN }}

View File

@ -21,185 +21,16 @@ on:
- v4-lts
jobs:
release-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/core'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'core'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/core
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-core
output: core/CoreBuild.zip
paths: core/dist core/components core/css core/hydrate core/loader core/src/components.d.ts
- name: Cache Built @ionic/docs
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-docs
output: docs/DocsBuild.zip
paths: docs/core.json docs/core.d.ts
release-docs:
needs: [release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/docs built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-docs
path: ./docs
filename: DocsBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/docs'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'docs'
token: ${{ secrets.NPM_TOKEN }}
release-angular:
needs: [release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/angular'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'angular'
folder: './dist'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/angular
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-angular
output: ./angular/AngularBuild.zip
paths: ./angular/dist
release-react:
needs: [release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/react'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/react'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/react
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-react
output: packages/react/ReactBuild.zip
paths: packages/react/dist packages/react/css
release-vue:
needs: [release-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/core built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
path: ./core
filename: CoreBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/vue'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/vue'
token: ${{ secrets.NPM_TOKEN }}
- name: Cache Built @ionic/vue
uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-vue
output: packages/vue/VueBuild.zip
paths: packages/vue/dist packages/vue/css
release-angular-server:
needs: [release-angular]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/angular built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-angular
path: ./angular
filename: AngularBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/angular-server'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/angular-server'
folder: './dist'
token: ${{ secrets.NPM_TOKEN }}
release-react-router:
needs: [release-react]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/react built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-react
path: ./packages/react
filename: ReactBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/react-router'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/react-router'
token: ${{ secrets.NPM_TOKEN }}
release-vue-router:
needs: [release-vue]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore @ionic/vue built cache
uses: ./.github/workflows/actions/download-archive
with:
name: ionic-vue
path: ./packages/vue
filename: VueBuild.zip
- uses: ./.github/workflows/actions/release
with:
scope: '@ionic/vue-router'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: 'packages/vue-router'
token: ${{ secrets.NPM_TOKEN }}
release-ionic:
uses: ./.github/workflows/release-ionic.yml
with:
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
finalize-release:
needs: [release-react-router, release-angular-server, release-vue-router]
needs: [release-ionic]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3