2021-05-31 07:33:02 +12:00
|
|
|
name: Publish dev
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 */12 * * *'
|
2022-08-16 21:00:17 +12:00
|
|
|
workflow_dispatch:
|
2021-05-31 07:33:02 +12:00
|
|
|
jobs:
|
2022-07-21 06:24:09 +12:00
|
|
|
npm-publish:
|
|
|
|
name: npm publish
|
2022-02-05 09:23:43 +13:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-02-05 09:58:22 +13:00
|
|
|
include:
|
2022-10-14 09:20:36 +13:00
|
|
|
- package: '@discordjs/brokers'
|
|
|
|
folder: 'brokers'
|
2022-02-05 09:58:22 +13:00
|
|
|
- package: '@discordjs/builders'
|
|
|
|
folder: 'builders'
|
|
|
|
- package: '@discordjs/collection'
|
|
|
|
folder: 'collection'
|
2022-11-28 21:14:16 +13:00
|
|
|
- package: '@discordjs/core'
|
|
|
|
folder: 'core'
|
2022-12-03 01:55:00 +13:00
|
|
|
- package: '@discordjs/formatters'
|
|
|
|
folder: 'formatters'
|
2022-02-05 09:58:22 +13:00
|
|
|
- package: 'discord.js'
|
|
|
|
folder: 'discord.js'
|
2023-01-12 22:27:07 +13:00
|
|
|
- package: '@discordjs/next'
|
|
|
|
folder: 'next'
|
2022-06-04 23:26:25 +12:00
|
|
|
- package: '@discordjs/proxy'
|
|
|
|
folder: 'proxy'
|
2022-02-05 09:58:22 +13:00
|
|
|
- package: '@discordjs/rest'
|
|
|
|
folder: 'rest'
|
2022-10-04 01:08:03 +13:00
|
|
|
- package: '@discordjs/util'
|
|
|
|
folder: 'util'
|
2022-02-05 09:58:22 +13:00
|
|
|
- package: '@discordjs/voice'
|
|
|
|
folder: 'voice'
|
2022-07-25 04:49:06 +12:00
|
|
|
- package: '@discordjs/ws'
|
|
|
|
folder: 'ws'
|
2021-05-31 07:33:02 +12:00
|
|
|
runs-on: ubuntu-latest
|
2024-03-05 10:11:32 +13:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
2022-08-16 00:19:17 +12:00
|
|
|
env:
|
|
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
2022-01-17 09:24:31 +13:00
|
|
|
if: github.repository_owner == 'discordjs'
|
2021-05-31 07:33:02 +12:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-05-13 21:35:25 +12:00
|
|
|
uses: actions/checkout@v4
|
2023-07-31 09:08:46 +12:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-05-31 07:33:02 +12:00
|
|
|
|
2024-05-13 21:35:25 +12:00
|
|
|
- name: Install Node.js v20
|
|
|
|
uses: actions/setup-node@v4
|
2021-05-31 07:33:02 +12:00
|
|
|
with:
|
2024-05-13 21:35:25 +12:00
|
|
|
node-version: 20
|
2021-05-31 13:23:48 +12:00
|
|
|
registry-url: https://registry.npmjs.org/
|
2022-01-09 11:30:28 +13:00
|
|
|
|
2023-10-04 07:05:22 +13:00
|
|
|
- name: Check the current development version
|
2023-10-08 10:35:11 +13:00
|
|
|
id: release-check
|
2023-10-04 07:05:22 +13:00
|
|
|
run: |
|
|
|
|
if [[ $(npm view ${{ matrix.package }}@dev version | grep -e "$(git rev-parse --short HEAD)") ]]; \
|
2023-10-08 10:35:11 +13:00
|
|
|
then echo "RELEASE=0" >> "$GITHUB_OUTPUT"; \
|
|
|
|
else echo "RELEASE=1" >> "$GITHUB_OUTPUT"; \
|
|
|
|
fi
|
2023-10-04 07:05:22 +13:00
|
|
|
|
2022-07-21 03:22:57 +12:00
|
|
|
- name: Install dependencies
|
2023-10-08 10:35:11 +13:00
|
|
|
if: steps.release-check.outputs.release == '1'
|
2023-08-28 06:24:03 +12:00
|
|
|
uses: ./packages/actions/src/pnpmCache
|
2022-07-21 03:22:57 +12:00
|
|
|
|
|
|
|
- name: Build dependencies
|
2023-10-08 10:35:11 +13:00
|
|
|
if: steps.release-check.outputs.release == '1'
|
2023-08-28 06:24:03 +12:00
|
|
|
run: pnpm run build
|
2022-07-21 03:22:57 +12:00
|
|
|
|
2022-07-21 06:24:09 +12:00
|
|
|
- name: Publish package
|
2023-10-08 10:35:11 +13:00
|
|
|
if: steps.release-check.outputs.release == '1'
|
2021-05-31 07:33:02 +12:00
|
|
|
run: |
|
2023-08-28 06:24:03 +12:00
|
|
|
pnpm --filter=${{ matrix.package }} run release --preid "dev.$(date +%s)-$(git rev-parse --short HEAD)"
|
2024-03-05 10:11:32 +13:00
|
|
|
pnpm --filter=${{ matrix.package }} publish --provenance --no-git-checks --tag dev || true
|
2021-05-31 07:33:02 +12:00
|
|
|
env:
|
2023-09-17 07:53:49 +12:00
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
2023-09-20 05:47:50 +12:00
|
|
|
|
|
|
|
- name: Deprecate prior development releases
|
2023-10-08 10:35:11 +13:00
|
|
|
if: steps.release-check.outputs.release == '1'
|
2023-09-20 05:47:50 +12:00
|
|
|
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 }}
|