mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
ci: Disable publishing multiple dev versions under the same commit (#9740)
* chore: disable publishing mutliple versions Co-authored-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Co-authored-by: Rodrigo Leitão <38259440+ImRodry@users.noreply.github.com> * Update .github/workflows/publish-dev.yml Co-authored-by: Aura Román <kyradiscord@gmail.com> * fix: commit suggestion Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * chore: add suggested changes * style: add back line --------- Co-authored-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Co-authored-by: Rodrigo Leitão <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Aura Román <kyradiscord@gmail.com> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
11
.github/workflows/publish-dev.yml
vendored
11
.github/workflows/publish-dev.yml
vendored
@@ -51,13 +51,23 @@ jobs:
|
||||
node-version: 18
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Check the current development version
|
||||
id: pre-release
|
||||
run: |
|
||||
if [[ $(npm view ${{ matrix.package }}@dev version | grep -e "$(git rev-parse --short HEAD)") ]]; \
|
||||
then echo '::set-output name=release::false'; \
|
||||
else echo '::set-output name=release::true'; fi
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.pre-release.outputs.release == 'true'
|
||||
uses: ./packages/actions/src/pnpmCache
|
||||
|
||||
- name: Build dependencies
|
||||
if: steps.pre-release.outputs.release == 'true'
|
||||
run: pnpm run build
|
||||
|
||||
- name: Publish package
|
||||
if: steps.pre-release.outputs.release == 'true'
|
||||
run: |
|
||||
pnpm --filter=${{ matrix.package }} run release --preid "dev.$(date +%s)-$(git rev-parse --short HEAD)"
|
||||
pnpm --filter=${{ matrix.package }} publish --no-git-checks --tag dev || true
|
||||
@@ -65,6 +75,7 @@ jobs:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
|
||||
- name: Deprecate prior development releases
|
||||
if: steps.pre-release.outputs.release == 'true'
|
||||
run: pnpm exec npm-deprecate --name "*dev*" --message "This version is deprecated. Please use a newer version." --package ${{ matrix.package }}
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user