Skip to content

Commit c48cb6a

Browse files
authored
Merge pull request #13 from BeAPI/feat/github-workflows-nla
Feat/GitHub workflows nla
2 parents 51ace27 + a101948 commit c48cb6a

12 files changed

Lines changed: 49 additions & 52043 deletions

.github/workflows/build-release-assets.yml

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,83 +15,53 @@ jobs:
1515
- id: extract-plugin-version
1616
name: "Extract plugin version number from .version-data.json file."
1717
run: |
18-
# Path to the version data file
19-
DSFR_BLOCKS_VERSION_FILE="$GITHUB_WORKSPACE/wp-dsfr-blocks/.version-data.json"
20-
21-
# Parse the file and extract the version
22-
DSFR_BLOCKS_VERSION=$(cat DSFR_BLOCKS_VERSION_FILE | jq .version)
18+
# Parse .version-data.json file and extract the version
19+
DSFR_BLOCKS_VERSION=$(cat ./wp-dsfr-blocks/.version-data.json | jq .version)
2320
2421
# Send the version to the output
2522
echo "dsfr-blocks-version=$DSFR_BLOCKS_VERSION" >> "$GITHUB_OUTPUT"
2623
2724
- id: extract-theme-version
2825
name: "Extract theme version number from .version-data.json file."
2926
run: |
30-
# Path to the version data file
31-
DSFR_THEME_VERSION_FILE="$GITHUB_WORKSPACE/wp-dsfr-theme/.version-data.json"
32-
33-
# Parse the file and extract the version
34-
DSFR_THEME_VERSION=$(cat DSFR_THEME_VERSION_FILE | jq .version)
27+
# Parse .version-data.json file and extract the version
28+
DSFR_THEME_VERSION=$(cat ./wp-dsfr-theme/.version-data.json | jq .version)
3529
3630
# Send the version to the output
3731
echo "dsfr-theme-version=$DSFR_THEME_VERSION" >> "$GITHUB_OUTPUT"
3832
3933
- id: dsfr-blocks-build-node
40-
name: "WP DSFR Blocks : Build project CSS and JS"
34+
name: "WP DSFR Blocks : Build project CSS and JS. Zip wp-dsfr-blocks folder."
4135
uses: actions/setup-node@v4
4236
with:
43-
node-version-file: 'package.json'
44-
- run: npm ci
45-
- run: npm run build
46-
working-directory: ./wp-dsfr-blocks
37+
node-version-file: './wp-dsfr-blocks/package.json'
38+
- run: cd ./wp-dsfr-blocks/ && npm install && npm run build && npm run plugin-zip && cd ../
4739

4840
- id: dsfr-theme-build-node
49-
name: "WP DSFR Theme : Build project CSS and JS"
50-
uses: actions/setup-node@v4
51-
with:
52-
node-version-file: 'package.json'
53-
- run: npm ci
54-
- run: npm run build
55-
working-directory: ./wp-dsfr-theme
56-
57-
- id: build-wp-dsfr-blocks-archive
58-
name: "Build WP DSFR Blocks archive"
59-
uses: actions/setup-node@v4
60-
with:
61-
node-version-file: 'package.json'
62-
run: |
63-
npm ci
64-
npm run plugin-zip
65-
working-directory: "./wp-dsfr-blocks"
66-
67-
- id: build-wp-dsfr-theme-archive
68-
name: "Build WP DSFR Theme archive"
41+
name: "WP DSFR Theme : Build project CSS and JS. Zip wp-dsfr-theme folder."
6942
uses: actions/setup-node@v4
7043
with:
71-
node-version-file: 'package.json'
72-
run: |
73-
npm ci
74-
npm run plugin-zip
75-
working-directory: "./wp-dsfr-theme"
44+
node-version-file: './wp-dsfr-theme/package.json'
45+
- run: cd ./wp-dsfr-theme/ && npm install && npm run build && npm run plugin-zip && cd ../
7646

7747
- id: upload-wp-dsfr-blocks-asset
7848
name: "Upload WP DSFR Blocks archive to the release"
7949
uses: actions/upload-release-asset@v1
8050
env:
8151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
with:
83-
upload_url: ${{ github.event.release.upload_url }}
84-
asset_path: ./wp-dsfr-blocks/wp-dsfr-blocks.zip
85-
asset_name: wp-dsfr-blocks-${{ steps.extract-plugin-version.outputs.dsfr-blocks-version }}.zip
86-
asset_content_type: application/zip
52+
with:
53+
upload_url: ${{ github.event.release.upload_url }}
54+
asset_path: ./wp-dsfr-blocks/wp-dsfr-blocks.zip
55+
asset_name: wp-dsfr-blocks-${{ steps.extract-plugin-version.outputs.dsfr-blocks-version }}.zip
56+
asset_content_type: application/zip
8757

8858
- id: upload-wp-dsfr-theme-asset
8959
name: "Upload WP DSFR Theme archive to the release"
9060
uses: actions/upload-release-asset@v1
9161
env:
9262
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93-
with:
94-
upload_url: ${{ github.event.release.upload_url }}
95-
asset_path: ./wp-dsfr-theme/wp-dsfr-theme.zip
96-
asset_name: wp-dsfr-theme-${{ steps.extract-theme-version.outputs.dsfr-theme-version }}.zip
97-
asset_content_type: application/zip
63+
with:
64+
upload_url: ${{ github.event.release.upload_url }}
65+
asset_path: ./wp-dsfr-theme/wp-dsfr-theme.zip
66+
asset_name: wp-dsfr-theme-${{ steps.extract-theme-version.outputs.dsfr-theme-version }}.zip
67+
asset_content_type: application/zip

.github/workflows/release-version.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ jobs:
1717
- id: parse
1818
name: "Extract version number from .version-data.json file."
1919
run: |
20-
# Path to the version data file
21-
DSFR_VERSION_FILE="$GITHUB_WORKSPACE/.version-data.json"
22-
23-
# Parse the file and extract the version
24-
DSFR_VERSION=$(cat DSFR_VERSION_FILE | jq .version)
20+
# Parse .version-data.json file and extract the version
21+
DSFR_VERSION=$(cat ./.version-data.json | jq .version)
2522
2623
# Send the version to the output
2724
echo "dsfr-project-version=$DSFR_VERSION" >> "$GITHUB_OUTPUT"
@@ -41,19 +38,15 @@ jobs:
4138
name: "WP DSFR Blocks : Build project CSS and JS"
4239
uses: actions/setup-node@v4
4340
with:
44-
node-version-file: 'package.json'
45-
- run: npm ci
46-
- run: npm run build
47-
working-directory: ./wp-dsfr-blocks
41+
node-version-file: './wp-dsfr-blocks/package.json'
42+
- run: cd ./wp-dsfr-blocks/ && npm install && npm run build && cd ../
4843

4944
- id: dsfr-theme-build-node
5045
name: "WP DSFR Theme : Build project CSS and JS"
5146
uses: actions/setup-node@v4
5247
with:
53-
node-version-file: 'package.json'
54-
- run: npm ci
55-
- run: npm run build
56-
working-directory: ./wp-dsfr-theme
48+
node-version-file: './wp-dsfr-theme/package.json'
49+
- run: cd ./wp-dsfr-theme/ && npm install && npm run build && cd ../
5750

5851
- id: commit-and-push
5952
name: "Commit and push new TAG"

.github/workflows/validate-project-version.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ jobs:
1717
- id: parse
1818
name: "Extract version number from .version-data.json file."
1919
run: |
20-
# Path to the version data file
21-
DSFR_VERSION_FILE="$GITHUB_WORKSPACE/.version-data.json"
22-
23-
# Parse the file and extract the version
24-
DSFR_VERSION=$(cat DSFR_VERSION_FILE | jq .version)
20+
# Parse .version-data.json file and extract the version
21+
DSFR_VERSION=$(cat ./.version-data.json | jq .version)
2522
2623
# Send the version to the output
2724
echo "dsfr-project-version=$DSFR_VERSION" >> $GITHUB_OUTPUT

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
# Repository
88
/node_modules
9+
package-lock.json
910

1011
# DSFR Theme
1112
/wp-dsfr-theme/node_modules

.version-data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"version": "2024.1"
3-
}
3+
}

0 commit comments

Comments
 (0)