Skip to content

Commit 39eacec

Browse files
authored
ci: use single matrix for all prerelease artifacts (#5362)
It is easy to forget to update all artifacts on a new MV, so consolidate all artifacts under same matrix
1 parent 68a179a commit 39eacec

File tree

1 file changed

+14
-71
lines changed

1 file changed

+14
-71
lines changed

.github/workflows/prerelease.yml

Lines changed: 14 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
generate_artifact_toolkit_standalone:
17+
generate_artifact:
1818
strategy:
1919
matrix:
20-
supported_versions: [ '2024.1', '2024.2', '2024.3', '2025.1' ]
20+
build_target: [ ':plugin-core:buildPlugin', ':plugin-toolkit:intellij-standalone:buildPlugin', ':plugin-amazonq:buildPlugin' ]
21+
version: [ '2024.1', '2024.2', '2024.3', '2025.1' ]
2122
runs-on: ubuntu-latest
2223
steps:
2324
- uses: actions/checkout@v4
@@ -38,71 +39,19 @@ jobs:
3839
dotnet-version: '6.x'
3940
- name: Generate artifact
4041
run: |
41-
./gradlew -PideProfileName=${{ matrix.supported_versions }} :plugin-toolkit:intellij-standalone:buildPlugin
42-
- name: Upload artifact
43-
uses: actions/upload-artifact@v4
44-
with:
45-
name: plugin-standalone-${{ matrix.supported_versions }}
46-
path: ./plugins/toolkit/intellij-standalone/build/distributions/*.zip
47-
retention-days: 1
48-
49-
generate_artifact_q:
50-
strategy:
51-
matrix:
52-
supported_versions: [ '2024.1', '2024.2', '2024.3' ]
53-
runs-on: ubuntu-latest
54-
steps:
55-
- uses: actions/checkout@v4
56-
with:
57-
fetch-depth: 0
58-
- name: remove unwanted dependencies
59-
run: |
60-
sudo rm -rf /usr/share/dotnet
61-
sudo rm -rf /opt/ghc
62-
sudo rm -rf "/usr/local/share/boost"
63-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
64-
- uses: actions/setup-java@v4
65-
with:
66-
distribution: 'corretto'
67-
java-version: '21'
68-
- name: Generate artifact
69-
run: |
70-
./gradlew -PideProfileName=${{ matrix.supported_versions }} :plugin-amazonq:buildPlugin
71-
- name: Upload artifact
72-
uses: actions/upload-artifact@v4
73-
with:
74-
name: plugin-amazonq-${{ matrix.supported_versions }}
75-
path: ./plugins/amazonq/build/distributions/*.zip
76-
retention-days: 1
77-
78-
generate_artifact_core:
79-
strategy:
80-
matrix:
81-
supported_versions: [ '2024.1', '2024.2', '2024.3' ]
82-
runs-on: ubuntu-latest
83-
steps:
84-
- uses: actions/checkout@v4
85-
with:
86-
fetch-depth: 0
87-
- name: remove unwanted dependencies
88-
run: |
89-
sudo rm -rf /usr/share/dotnet
90-
sudo rm -rf /opt/ghc
91-
sudo rm -rf "/usr/local/share/boost"
92-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
93-
- uses: actions/setup-java@v4
94-
with:
95-
distribution: 'corretto'
96-
java-version: '21'
97-
98-
- name: Generate artifact
42+
./gradlew -PideProfileName=${{ matrix.version }} ${{ matrix.build_target }}
43+
- name: Fix artifact name
44+
env:
45+
BUILD_TARGET: "${{ matrix.build_target }}"
46+
ARTIFACT_NAME: "${{ matrix.build_target }}-${{ matrix.version }}"
9947
run: |
100-
./gradlew -PideProfileName=${{ matrix.supported_versions }} :plugin-core:buildPlugin
48+
echo "ARTIFACT_SUBPATH=$(echo $BUILD_TARGET | sed -e 's/^:plugin-//' -e 's/:buildPlugin$//' -e 's/:/\//')" >> $GITHUB_ENV
49+
echo "ARTIFACT_NAME=${ARTIFACT_NAME//:}" >> $GITHUB_ENV
10150
- name: Upload artifact
10251
uses: actions/upload-artifact@v4
10352
with:
104-
name: plugin-core-${{ matrix.supported_versions }}
105-
path: ./plugins/core/build/distributions/*.zip
53+
name: ${{ env.ARTIFACT_NAME }}
54+
path: ./plugins/${{ env.ARTIFACT_SUBPATH }}/build/distributions/*.zip
10655
retention-days: 1
10756

10857
generate_changelog:
@@ -148,7 +97,7 @@ jobs:
14897
echo 'EOF' >> $GITHUB_OUTPUT
14998
15099
publish:
151-
needs: [ generate_artifact_toolkit_standalone, generate_artifact_core, generate_artifact_q, generate_changelog ]
100+
needs: [ generate_artifact, generate_changelog ]
152101
env:
153102
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154103
GH_REPO: ${{ github.repository }}
@@ -172,13 +121,7 @@ jobs:
172121
- name: Publish to GitHub Releases
173122
run: |
174123
envsubst < "$GITHUB_WORKSPACE/.github/workflows/prerelease_notes.md" > "$RUNNER_TEMP/prerelease_notes.md"
175-
gh release create "$TAG_NAME" --prerelease --notes-file "$RUNNER_TEMP/prerelease_notes.md" --title "$SUBJECT" --target $GITHUB_SHA plugin-standalone-*/*.zip
176-
- name: Publish core
177-
run: |
178-
gh release upload "$TAG_NAME" plugin-core-*/*.zip
179-
- name: Publish Q
180-
run: |
181-
gh release upload "$TAG_NAME" plugin-amazonq-*/*.zip
124+
gh release create "$TAG_NAME" --prerelease --notes-file "$RUNNER_TEMP/prerelease_notes.md" --title "$SUBJECT" --target $GITHUB_SHA plugin*/*.zip
182125
- name: Publish XML manifest
183126
run: |
184127
gh release view "$TAG_NAME" --repo "$GITHUB_REPOSITORY" --json assets | python3 "$GITHUB_WORKSPACE/.github/workflows/generateUpdatesXml.py" - > updatePlugins.xml

0 commit comments

Comments
 (0)