-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (58 loc) · 2.61 KB
/
build-release-assets.yml
File metadata and controls
67 lines (58 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "Build release assets"
on:
release:
types:
- published
jobs:
build-archives:
name: "Build archives"
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- id: extract-plugin-version
name: "Extract plugin version number from .version-data.json file."
run: |
# Parse .version-data.json file and extract the version
DSFR_BLOCKS_VERSION=$(cat ./wp-dsfr-blocks/.version-data.json | jq .version)
# Send the version to the output
echo "dsfr-blocks-version=$DSFR_BLOCKS_VERSION" >> "$GITHUB_OUTPUT"
- id: extract-theme-version
name: "Extract theme version number from .version-data.json file."
run: |
# Parse .version-data.json file and extract the version
DSFR_THEME_VERSION=$(cat ./wp-dsfr-theme/.version-data.json | jq .version)
# Send the version to the output
echo "dsfr-theme-version=$DSFR_THEME_VERSION" >> "$GITHUB_OUTPUT"
- id: dsfr-blocks-build-node
name: "WP DSFR Blocks : Build project CSS and JS. Zip wp-dsfr-blocks folder."
uses: actions/setup-node@v4
with:
node-version-file: './wp-dsfr-blocks/package.json'
- run: cd ./wp-dsfr-blocks/ && npm install && npm run build && npm run plugin-zip && cd ../
- id: dsfr-theme-build-node
name: "WP DSFR Theme : Build project CSS and JS. Zip wp-dsfr-theme folder."
uses: actions/setup-node@v4
with:
node-version-file: './wp-dsfr-theme/package.json'
- run: cd ./wp-dsfr-theme/ && npm install && npm run build && npm run plugin-zip && cd ../
- id: upload-wp-dsfr-blocks-asset
name: "Upload WP DSFR Blocks archive to the release"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./wp-dsfr-blocks/wp-dsfr-blocks.zip
asset_name: wp-dsfr-blocks-${{ steps.extract-plugin-version.outputs.dsfr-blocks-version }}.zip
asset_content_type: application/zip
- id: upload-wp-dsfr-theme-asset
name: "Upload WP DSFR Theme archive to the release"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./wp-dsfr-theme/wp-dsfr-theme.zip
asset_name: wp-dsfr-theme-${{ steps.extract-theme-version.outputs.dsfr-theme-version }}.zip
asset_content_type: application/zip