Skip to content

Commit 2c2f88c

Browse files
committed
ci: change logic to parse version
1 parent 93defec commit 2c2f88c

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Diff for: .github/workflows/documentation.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,9 @@ jobs:
4848
name: docs
4949
path: packages/*/docs/docs.json
5050

51-
- uses: frabert/[email protected]
52-
id: SHORT_BRANCH_NAME
53-
with:
54-
pattern: '(^@\w+\/\w+@v?)?(?<semver>\d+.\d+.\d+)-?.*'
55-
string: ${{ env.BRANCH_NAME }}
56-
replace-with: '$<semver>'
57-
5851
- name: Set outputs for upload job
5952
id: env
6053
run: |
61-
echo "::set-output name=SHORT_BRANCH_NAME::${{ steps.SHORT_BRANCH_NAME.outputs.replaced }}"
6254
echo "::set-output name=BRANCH_NAME::${GITHUB_REF_NAME}"
6355
echo "::set-output name=BRANCH_OR_TAG::${GITHUB_REF_TYPE}"
6456
echo "::set-output name=SHA::${GITHUB_SHA}"
@@ -73,7 +65,6 @@ jobs:
7365
package: ['builders', 'collection', 'discord.js', 'rest', 'voice']
7466
runs-on: ubuntu-latest
7567
env:
76-
SHORT_BRANCH_NAME: ${{ needs.build.outputs.SHORT_BRANCH_NAME }}
7768
BRANCH_NAME: ${{ needs.build.outputs.BRANCH_NAME }}
7869
BRANCH_OR_TAG: ${{ needs.build.outputs.BRANCH_OR_TAG }}
7970
SHA: ${{ needs.build.outputs.SHA }}
@@ -92,11 +83,20 @@ jobs:
9283
path: 'out'
9384

9485
- name: Move docs to correct directory
86+
if: env.BRANCH_OR_TAG == 'tag'
87+
env:
88+
PACKAGE: ${{ matrix.package }}
89+
run: |
90+
mkdir -p out/${PACKAGE}
91+
mv docs/${PACKAGE}/docs/docs.json out/${PACKAGE}/$(jq --raw-output '.version' packages/${PACKAGE}/package.json).json
92+
93+
- name: Move docs to correct directory
94+
if: env.BRANCH_OR_TAG == 'branch'
9595
env:
9696
PACKAGE: ${{ matrix.package }}
9797
run: |
9898
mkdir -p out/${PACKAGE}
99-
mv docs/${PACKAGE}/docs/docs.json out/${PACKAGE}/${SHORT_BRANCH_NAME}.json
99+
mv docs/${PACKAGE}/docs/docs.json out/${PACKAGE}/${BRANCH_NAME}.json
100100
101101
- name: Commit and push
102102
run: |

Diff for: packages/builders/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@discordjs/builders",
3-
"version": "0.14.0-dev",
3+
"version": "0.13.0",
44
"description": "A set of builders that you can use when creating your bot",
55
"scripts": {
66
"build": "tsup",

Diff for: packages/collection/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@discordjs/collection",
3-
"version": "0.7.0-dev",
3+
"version": "0.6.0",
44
"description": "Utility data structure used in discord.js",
55
"scripts": {
66
"test": "jest --pass-with-no-tests",

Diff for: packages/rest/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@discordjs/rest",
3-
"version": "0.5.0-dev",
3+
"version": "0.4.0",
44
"description": "The REST API for discord.js",
55
"scripts": {
66
"build": "tsup && tsc --emitDeclarationOnly --incremental",

Diff for: packages/voice/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@discordjs/voice",
3-
"version": "0.10.0-dev",
3+
"version": "0.9.0",
44
"description": "Implementation of the Discord Voice API for node.js",
55
"scripts": {
66
"build": "tsup && node scripts/postbuild.mjs",

0 commit comments

Comments
 (0)