Skip to content

Commit 9fa92ac

Browse files
committed
ci: extract package and semver from tag
1 parent 2c2f88c commit 9fa92ac

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

.github/workflows/documentation.yml

+21-2
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,32 @@ jobs:
8282
token: ${{ secrets.DJS_DOCS }}
8383
path: 'out'
8484

85+
- name: 'Extract package from tag'
86+
if: env.BRANCH_OR_TAG == 'tag'
87+
id: package-name
88+
uses: frabert/[email protected]
89+
with:
90+
pattern: '(^@.*\\/(?<package>.*)@v?)?(?<semver>\d+.\d+.\d+)-?.*'
91+
string: ${{ env.BRANCH_NAME }}
92+
replace-with: '$<package>'
93+
94+
- name: 'Extract semver from tag'
95+
if: env.BRANCH_OR_TAG == 'tag'
96+
id: semver
97+
uses: frabert/[email protected]
98+
with:
99+
pattern: '(^@.*\\/(?<package>.*)@v?)?(?<semver>\d+.\d+.\d+)-?.*'
100+
string: ${{ env.BRANCH_NAME }}
101+
replace-with: '$<semver>'
102+
85103
- name: Move docs to correct directory
86104
if: env.BRANCH_OR_TAG == 'tag'
87105
env:
88-
PACKAGE: ${{ matrix.package }}
106+
PACKAGE: ${{ steps.package-name.outputs.replaced }}
107+
SEMVER: ${{ steps.semver.outputs.replaced }}
89108
run: |
90109
mkdir -p out/${PACKAGE}
91-
mv docs/${PACKAGE}/docs/docs.json out/${PACKAGE}/$(jq --raw-output '.version' packages/${PACKAGE}/package.json).json
110+
mv docs/${PACKAGE}/docs/docs.json out/${PACKAGE}/${SEMVER}.json
92111
93112
- name: Move docs to correct directory
94113
if: env.BRANCH_OR_TAG == 'branch'

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.13.0",
3+
"version": "0.14.0-dev",
44
"description": "A set of builders that you can use when creating your bot",
55
"scripts": {
66
"build": "tsup",

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.6.0",
3+
"version": "0.7.0-dev",
44
"description": "Utility data structure used in discord.js",
55
"scripts": {
66
"test": "jest --pass-with-no-tests",

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.4.0",
3+
"version": "0.5.0-dev",
44
"description": "The REST API for discord.js",
55
"scripts": {
66
"build": "tsup && tsc --emitDeclarationOnly --incremental",

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.9.0",
3+
"version": "0.10.0-dev",
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)