mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
ci: change logic to parse version
This commit is contained in:
20
.github/workflows/documentation.yml
vendored
20
.github/workflows/documentation.yml
vendored
@@ -48,17 +48,9 @@ jobs:
|
|||||||
name: docs
|
name: docs
|
||||||
path: packages/*/docs/docs.json
|
path: packages/*/docs/docs.json
|
||||||
|
|
||||||
- uses: frabert/replace-string-action@v2.0
|
|
||||||
id: SHORT_BRANCH_NAME
|
|
||||||
with:
|
|
||||||
pattern: '(^@\w+\/\w+@v?)?(?<semver>\d+.\d+.\d+)-?.*'
|
|
||||||
string: ${{ env.BRANCH_NAME }}
|
|
||||||
replace-with: '$<semver>'
|
|
||||||
|
|
||||||
- name: Set outputs for upload job
|
- name: Set outputs for upload job
|
||||||
id: env
|
id: env
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=SHORT_BRANCH_NAME::${{ steps.SHORT_BRANCH_NAME.outputs.replaced }}"
|
|
||||||
echo "::set-output name=BRANCH_NAME::${GITHUB_REF_NAME}"
|
echo "::set-output name=BRANCH_NAME::${GITHUB_REF_NAME}"
|
||||||
echo "::set-output name=BRANCH_OR_TAG::${GITHUB_REF_TYPE}"
|
echo "::set-output name=BRANCH_OR_TAG::${GITHUB_REF_TYPE}"
|
||||||
echo "::set-output name=SHA::${GITHUB_SHA}"
|
echo "::set-output name=SHA::${GITHUB_SHA}"
|
||||||
@@ -73,7 +65,6 @@ jobs:
|
|||||||
package: ['builders', 'collection', 'discord.js', 'rest', 'voice']
|
package: ['builders', 'collection', 'discord.js', 'rest', 'voice']
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
SHORT_BRANCH_NAME: ${{ needs.build.outputs.SHORT_BRANCH_NAME }}
|
|
||||||
BRANCH_NAME: ${{ needs.build.outputs.BRANCH_NAME }}
|
BRANCH_NAME: ${{ needs.build.outputs.BRANCH_NAME }}
|
||||||
BRANCH_OR_TAG: ${{ needs.build.outputs.BRANCH_OR_TAG }}
|
BRANCH_OR_TAG: ${{ needs.build.outputs.BRANCH_OR_TAG }}
|
||||||
SHA: ${{ needs.build.outputs.SHA }}
|
SHA: ${{ needs.build.outputs.SHA }}
|
||||||
@@ -92,11 +83,20 @@ jobs:
|
|||||||
path: 'out'
|
path: 'out'
|
||||||
|
|
||||||
- name: Move docs to correct directory
|
- name: Move docs to correct directory
|
||||||
|
if: env.BRANCH_OR_TAG == 'tag'
|
||||||
env:
|
env:
|
||||||
PACKAGE: ${{ matrix.package }}
|
PACKAGE: ${{ matrix.package }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p out/${PACKAGE}
|
mkdir -p out/${PACKAGE}
|
||||||
mv docs/${PACKAGE}/docs/docs.json out/${PACKAGE}/${SHORT_BRANCH_NAME}.json
|
mv docs/${PACKAGE}/docs/docs.json out/${PACKAGE}/$(jq --raw-output '.version' packages/${PACKAGE}/package.json).json
|
||||||
|
|
||||||
|
- name: Move docs to correct directory
|
||||||
|
if: env.BRANCH_OR_TAG == 'branch'
|
||||||
|
env:
|
||||||
|
PACKAGE: ${{ matrix.package }}
|
||||||
|
run: |
|
||||||
|
mkdir -p out/${PACKAGE}
|
||||||
|
mv docs/${PACKAGE}/docs/docs.json out/${PACKAGE}/${BRANCH_NAME}.json
|
||||||
|
|
||||||
- name: Commit and push
|
- name: Commit and push
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@discordjs/builders",
|
"name": "@discordjs/builders",
|
||||||
"version": "0.14.0-dev",
|
"version": "0.13.0",
|
||||||
"description": "A set of builders that you can use when creating your bot",
|
"description": "A set of builders that you can use when creating your bot",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@discordjs/collection",
|
"name": "@discordjs/collection",
|
||||||
"version": "0.7.0-dev",
|
"version": "0.6.0",
|
||||||
"description": "Utility data structure used in discord.js",
|
"description": "Utility data structure used in discord.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --pass-with-no-tests",
|
"test": "jest --pass-with-no-tests",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@discordjs/rest",
|
"name": "@discordjs/rest",
|
||||||
"version": "0.5.0-dev",
|
"version": "0.4.0",
|
||||||
"description": "The REST API for discord.js",
|
"description": "The REST API for discord.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup && tsc --emitDeclarationOnly --incremental",
|
"build": "tsup && tsc --emitDeclarationOnly --incremental",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@discordjs/voice",
|
"name": "@discordjs/voice",
|
||||||
"version": "0.10.0-dev",
|
"version": "0.9.0",
|
||||||
"description": "Implementation of the Discord Voice API for node.js",
|
"description": "Implementation of the Discord Voice API for node.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup && node scripts/postbuild.mjs",
|
"build": "tsup && node scripts/postbuild.mjs",
|
||||||
|
|||||||
Reference in New Issue
Block a user