diff --git a/.github/workflows/actions/publish-npm/action.yml b/.github/workflows/actions/publish-npm/action.yml index 72a520b25..fce7c85ca 100644 --- a/.github/workflows/actions/publish-npm/action.yml +++ b/.github/workflows/actions/publish-npm/action.yml @@ -10,13 +10,9 @@ inputs: folder: default: './' description: 'A folder containing a package.json file.' - token: - description: 'The NPM authentication token required to publish.' - createRelease: description: 'Create a release on GitHub.' default: 'false' - ghToken: description: 'The GitHub authentication token required to create a release.' @@ -49,12 +45,6 @@ runs: run: npm run build shell: bash working-directory: ${{ inputs.working-directory }} - - name: Prepare NPM Token - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc - working-directory: ${{ inputs.working-directory }} - shell: bash - env: - NPM_TOKEN: ${{ inputs.token }} - name: Publish to NPM run: npm publish ${{ inputs.folder }} --tag ${{ inputs.tag }} --provenance shell: bash diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-release.yml similarity index 92% rename from .github/workflows/dev-build.yml rename to .github/workflows/dev-release.yml index e46ba9aa7..96f08ba37 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-release.yml @@ -1,7 +1,7 @@ -name: 'Ionicons Dev Build' +name: 'Dev Release' on: - workflow_dispatch: + workflow_call: jobs: create-dev-hash: @@ -33,7 +33,6 @@ jobs: tag: dev version: ${{ needs.create-dev-hash.outputs.dev-hash }} working-directory: './' - token: ${{ secrets.NPM_TOKEN }} createRelease: 'false' get-build: diff --git a/.github/workflows/release.yml b/.github/workflows/production-release.yml similarity index 52% rename from .github/workflows/release.yml rename to .github/workflows/production-release.yml index 15401bd66..20938cd04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/production-release.yml @@ -1,22 +1,12 @@ -name: 'Ionicons Production Release' +name: 'Production Release' on: - workflow_dispatch: + workflow_call: 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 + required: false + type: string + description: npm version (major, minor, or patch) jobs: release-ionicons: @@ -31,9 +21,8 @@ jobs: - name: Publish to NPM uses: ./.github/workflows/actions/publish-npm with: - tag: ${{ inputs.tag }} + tag: latest version: ${{ inputs.version }} working-directory: './' - token: ${{ secrets.NPM_TOKEN }} createRelease: true ghToken: ${{ secrets.IONITRON_TOKEN }} diff --git a/.github/workflows/release-orchestrator.yml b/.github/workflows/release-orchestrator.yml new file mode 100644 index 000000000..b8abf2d1a --- /dev/null +++ b/.github/workflows/release-orchestrator.yml @@ -0,0 +1,37 @@ +name: 'Release Orchestrator' + +on: + workflow_dispatch: + inputs: + release-type: + description: 'Release type' + required: true + type: choice + options: + - dev + - production + version: + description: 'Version for production releases' + required: false + type: choice + options: + - patch + - minor + - major + +permissions: + id-token: write + contents: read + +jobs: + run-dev: + if: ${{ inputs.release-type == 'dev' }} + uses: ./.github/workflows/dev-release.yml + secrets: inherit + + run-production: + if: ${{ inputs.release-type == 'production' }} + uses: ./.github/workflows/production-release.yml + secrets: inherit + with: + version: ${{ inputs.version }} diff --git a/.github/workflows/build.yml b/.github/workflows/validation.yml similarity index 98% rename from .github/workflows/build.yml rename to .github/workflows/validation.yml index 0b1f1ddf1..f79d94a5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/validation.yml @@ -1,4 +1,4 @@ -name: 'Ionicons Build' +name: 'Validation' on: pull_request: