Skip to content

Commit fdbbce7

Browse files
committed
Fixed release package process POC.
POC
1 parent 64a3fdd commit fdbbce7

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

.github/actions/release-plugin/action.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,44 @@ branding:
44
icon: 'upload-cloud'
55
color: 'blue'
66

7+
inputs:
8+
github_token:
9+
description: 'GitHub Token'
10+
required: true
11+
712
outputs:
813
zip-path:
914
description: 'Path to zip file'
10-
value: ${{ steps.zip.outputs.zip-path }}
15+
value: ${{ steps.zip-main-release-for-github.outputs.zip-path }}
1116
org-zip-path:
1217
description: 'Path to .org zip file'
13-
value: ${{ steps.zip-org.outputs.zip-path }}
18+
value: ${{ steps.zip-org-release-for-github.outputs.zip-path }}
1419

1520
runs:
1621
using: 'composite'
1722
steps:
1823
- id: prepare
1924
name: Prepare Environment
20-
run: |
21-
sudo apt-get update && sudo apt-get install zip rsync -y
25+
run: sudo apt-get update && sudo apt-get install zip rsync -y
2226
shell: bash
2327

2428
- id: zip-main-release-for-github
2529
name: Zip plugin for the main release
2630
run: |
27-
# Create dist folder and copy files while excluding .distignore items
2831
mkdir -p dist
2932
rsync -av --exclude-from="${{ env.PLUGIN_DIR }}/.distignore" ${{ env.PLUGIN_DIR }}/ dist/${{ env.SLUG }}
3033
3134
zip_file="faustwp-${{ env.VERSION }}.zip"
3235
zip -r "$zip_file" "dist/${{ env.SLUG }}"
3336
34-
# Save zip path to output
35-
echo "::set-output name=zip-path::$PWD/$zip_file"
37+
echo "zip-path=$PWD/$zip_file" >> $GITHUB_ENV
3638
shell: bash
3739

3840
- id: zip-org-release-for-github
3941
name: Zip plugin for the non wpe-updater release
4042
run: |
4143
# Delete old directory
4244
rm -rf dist
43-
4445
# Create dist folder and copy files while excluding .distignore items
4546
mkdir -p dist
4647
# Copy plugin files to dist folder and exclude external updater
@@ -54,23 +55,23 @@ runs:
5455
zip -r "$org_zip_file" "dist/${{ env.SLUG }}"
5556
5657
# Save zip path to output
57-
echo "::set-output name=zip-path::$PWD/$org_zip_file"
58+
echo "org-zip-path=$PWD/$org_zip_file" >> $GITHUB_ENV
5859
shell: bash
5960

6061
- id: upload-main-release-to-github
6162
name: Uploads the main release zip file to GitHub
6263
uses: softprops/action-gh-release@v2
6364
with:
64-
token: ${{ secrets.GITHUB_TOKEN }}
65-
files: ${{ steps.zip.outputs.zip-path }}
65+
token: ${{ inputs.github_token }}
66+
files: ${{ env.zip-path }}
6667
asset_name: faustwp-${{ env.VERSION }}.zip
6768
overwrite: true
6869

6970
- id: upload-org-release-to-github
7071
name: Uploads the non wpe-updater release zip file to GitHub
7172
uses: softprops/action-gh-release@v2
7273
with:
73-
token: ${{ secrets.GITHUB_TOKEN }}
74-
files: ${{ steps.zip-org.outputs.zip-path }}
74+
token: ${{ inputs.github_token }}
75+
files: ${{ env.org-zip-path }}
7576
asset_name: faustwp-${{ env.VERSION }}.org.zip
7677
overwrite: true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Release Packages
1+
name: Debug GitHub Actions Environment
22

33
on:
44
push:

.github/workflows/release-packages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ jobs:
5353
# https://github.com/changesets/action#outputs
5454
if: steps.changesets.outputs.published && contains(steps.changesets.outputs.publishedPackages, '"@faustwp/wordpress-plugin"')
5555
uses: ./.github/actions/release-plugin
56+
with:
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
5658
env:
5759
PLUGIN_DIR: plugins/faustwp
5860
SLUG: faustwp

0 commit comments

Comments
 (0)