From 99cbfb0ecc13ee34d8b82add6b10ad91bec5a7c4 Mon Sep 17 00:00:00 2001 From: Julian Skinner Date: Wed, 25 Oct 2023 13:51:35 -0500 Subject: [PATCH] ci: refactor nightly to use release workflow renamed release-icons to publish-icons workflow --- .github/workflows/icon-export.yml | 18 ++-- .github/workflows/nightly.yml | 3 +- .../{release-icons.yml => publish-icons.yml} | 4 +- .github/workflows/release.yml | 83 +++++++++++++++++++ 4 files changed, 92 insertions(+), 16 deletions(-) rename .github/workflows/{release-icons.yml => publish-icons.yml} (97%) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/icon-export.yml b/.github/workflows/icon-export.yml index 221c21c..a94ab9b 100644 --- a/.github/workflows/icon-export.yml +++ b/.github/workflows/icon-export.yml @@ -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.' @@ -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 }} - diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0feaae4..23fee11 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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 + diff --git a/.github/workflows/release-icons.yml b/.github/workflows/publish-icons.yml similarity index 97% rename from .github/workflows/release-icons.yml rename to .github/workflows/publish-icons.yml index 5202dfb..7300fa7 100644 --- a/.github/workflows/release-icons.yml +++ b/.github/workflows/publish-icons.yml @@ -1,4 +1,4 @@ -name: 'Release Icons' +name: 'Publish Icons' on: workflow_call: @@ -28,7 +28,7 @@ on: required: true jobs: - release-icons: + publish-icons: runs-on: ubuntu-latest permissions: contents: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3da9e16 --- /dev/null +++ b/.github/workflows/release.yml @@ -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