Skip to content

Commit a127792

Browse files
committed
tune actions
1 parent 24b6963 commit a127792

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
jobs:
99
build-artifact:
1010
runs-on: ubuntu-latest
11+
outputs:
12+
plugin_version: ${{ steps.get_version.outputs.plugin_version }}
1113
steps:
1214
- name: Checkout code
1315
uses: actions/checkout@v4
@@ -25,36 +27,53 @@ jobs:
2527
id: get_version
2628
run: |
2729
version=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2)
28-
echo "PLUGIN_VERSION=$version" >> $GITHUB_ENV
30+
echo "$version" > plugin-version.txt
31+
echo "plugin_version=$version" >> $GITHUB_OUTPUT
2932
3033
- name: Build plugin
3134
run: ./gradlew buildPlugin
3235

3336
- name: Rename plugin artifact
3437
run: |
35-
mv build/distributions/*.zip YALI_${{ env.PLUGIN_VERSION }}.zip
38+
mv build/distributions/*.zip YALI_${{ steps.get_version.outputs.plugin_version }}.zip
3639
37-
- name: Upload artifact
40+
- name: Upload plugin artifact
3841
uses: actions/upload-artifact@v4
3942
with:
40-
name: YALI_${{ env.PLUGIN_VERSION }}
41-
path: YALI_${{ env.PLUGIN_VERSION }}.zip
43+
name: YALI_${{ steps.get_version.outputs.plugin_version }}
44+
path: YALI_${{ steps.get_version.outputs.plugin_version }}.zip
45+
46+
- name: Upload plugin version file
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: plugin-version
50+
path: plugin-version.txt
4251

4352
release:
4453
if: github.ref == 'refs/heads/master'
4554
needs: build-artifact
4655
runs-on: ubuntu-latest
4756
steps:
48-
- name: Download artifact
57+
- name: Download plugin version file
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: plugin-version
61+
- name: Read plugin version
62+
id: read_version
63+
run: |
64+
version=$(cat plugin-version.txt)
65+
echo "plugin_version=$version" >> $GITHUB_OUTPUT
66+
67+
- name: Download plugin artifact
4968
uses: actions/download-artifact@v4
5069
with:
51-
name: YALI_${{ env.PLUGIN_VERSION }}
70+
name: YALI_${{ steps.read_version.outputs.plugin_version }}
5271

5372
- name: Create Release and Upload Artifact
5473
uses: softprops/action-gh-release@v2
5574
with:
56-
tag_name: v${{ env.PLUGIN_VERSION }}
57-
name: Release v${{ env.PLUGIN_VERSION }}
58-
files: YALI_${{ env.PLUGIN_VERSION }}.zip
75+
tag_name: v${{ steps.read_version.outputs.plugin_version }}
76+
name: Release v${{ steps.read_version.outputs.plugin_version }}
77+
files: YALI_${{ steps.read_version.outputs.plugin_version }}.zip
5978
env:
6079
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)