Skip to content

Commit

Permalink
ci: refactor nightly to use release workflow
Browse files Browse the repository at this point in the history
renamed release-icons to publish-icons workflow
  • Loading branch information
ju-Skinner committed Oct 26, 2023
1 parent 8d39728 commit 99cbfb0
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 16 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/icon-export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: 'Run Icon Update'

on:
workflow_call:
outputs:
nextVersionType:
description: 'The next type of version to release.'
value: ${{ jobs.update-icons.outputs.nextVersionType }}

inputs:
preid:
description: 'The prerelease id used when doing a prerelease.'
Expand Down Expand Up @@ -101,16 +106,3 @@ jobs:
string: ${{ steps.version-type-info.outputs.VERSION_INFO }}
separator: ','
limit: 2

release:
needs: update-icons
uses: ./.github/workflows/release-icons.yml
if: ${{ needs.update-icons.outputs.nextVersionType != '' }}
with:
preid: ${{ needs.update-icons.outputs.preid }}
ref: ${{ inputs.ref }}
tag: ${{ inputs.tag }}
version: ${{ needs.update-icons.outputs.nextVersionType }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ on:

jobs:
export-icons:
uses: ./.github/workflows/icon-export.yml
uses: ./.github/workflows/release.yml
with:
preid: ${{ inputs.preid || '' }}
ref: ${{ inputs.ref || 'next' }}
tag: ${{ inputs.tag || 'nightly' }}
version: ${{inputs.version || '' }}
secrets: inherit

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Release Icons'
name: 'Publish Icons'

on:
workflow_call:
Expand Down Expand Up @@ -28,7 +28,7 @@ on:
required: true

jobs:
release-icons:
publish-icons:
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: "Pine Icons Production Release"

on:
workflow_call:
inputs:
preid:
description: Which prerelease id should be used? This is only needed when a version is "prepatch", "preminor", "premajor", or "prerelease".
type: string
default: ''

ref:
type: string
description: The branch name, tag, or SHA to be checked out. This can also be left blank.
default: ''

tag:
type: 'string'
required: true
description: Which npm tag should this be published to

version:
type: string
description: Which version should be published?

workflow_dispatch:
inputs:
preid:
type: choice
description: Which prerelease id should be used? This is only needed when a version is "prepatch", "preminor", "premajor", or "prerelease".
options:
- ''
- alpha
- beta
- rc
- next

ref:
type: string
description: The branch name, tag, or SHA to be checked out. This can also be left blank.
default: ''

tag:
type: choice
required: true
description: Which npm tag should this be published to
options:
- latest
- next
- dev

version:
type: choice
description: Which version should be published?
options:
- ''
- patch
- minor
- major
- prepatch
- preminor
- premajor
- prerelease

jobs:
export-icons:
uses: ./.github/workflows/icon-export.yml
with:
preid: ${{ inputs.preid || '' }}
ref: ${{ inputs.ref || 'next' }}
tag: ${{ inputs.tag || 'nightly' }}
version: ${{ inputs.version || '' }}
secrets: inherit

publish-icons:
uses: ./.github/workflows/publish-icons.yml
needs: export-icons
if: ${{ needs.export-icons.outputs.nextVersionType != '' }}
with:
preid: ${{ inputs.preid}}
ref: ${{ inputs.ref }}
tag: ${{ inputs.tag }}
version: ${{inputs.version }}
secrets: inherit

0 comments on commit 99cbfb0

Please sign in to comment.