@@ -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
0 commit comments