88 required : true
99
1010jobs :
11- gh_tagged_release :
11+ build :
1212 name : Create tagged release
1313 runs-on : ${{ matrix.os }}
1414 strategy :
@@ -126,29 +126,21 @@ jobs:
126126 aspect-model-editor-runtime/target/*.bat
127127 aspect-model-editor-runtime/target/lib/
128128
129- # Release Mac and Linux executables
130- - name : Create GitHub release (Mac)
131- if : ${{ (matrix.os == 'macos-12') && (!contains( github.ref, '-M' )) }}
132- uses : svenstaro/upload-release-action@latest
129+ - name : Upload binary (Mac)
130+ if : matrix.os == 'macos-12'
131+ uses : actions/upload-artifact@v4
133132 with :
134- file_glob : true
135- overwrite : true
136- prerelease : false
137- repo_token : ${{ secrets.GITHUB_TOKEN }}
138- file : aspect-model-editor-runtime/target/ame-backend!(*.txt)-mac
139- tag : v${{ github.event.inputs.release_version }}
133+ name : ame-backend-v${{ github.event.inputs.release_version }}-mac
134+ path : aspect-model-editor-runtime/target/ame-backend-${{ github.event.inputs.release_version }}-mac
140135
141- - name : Create GitHub pre-release (Mac )
142- if : ${{ ( matrix.os == 'macos-12') && (contains( github.ref, '-M' )) }}
143- uses : svenstaro /upload-release-action@latest
136+ - name : Upload binary (Linux )
137+ if : matrix.os == 'ubuntu-20.04'
138+ uses : actions /upload-artifact@v4
144139 with :
145- file_glob : true
146- overwrite : true
147- prerelease : true
148- repo_token : ${{ secrets.GITHUB_TOKEN }}
149- file : aspect-model-editor-runtime/target/ame-backend!(*.txt)-mac
150- tag : v${{ github.event.inputs.release_version }}
140+ name : ame-backend-v${{ github.event.inputs.release_version }}-linux
141+ path : aspect-model-editor-runtime/target/ame-backend-${{ github.event.inputs.release_version }}-linux
151142
143+ # Release Linux executables
152144 - name : Create GitHub release (Linux)
153145 if : ${{ (matrix.os == 'ubuntu-20.04') && (!contains( github.ref, '-M' )) }}
154146 uses : svenstaro/upload-release-action@latest
@@ -157,7 +149,7 @@ jobs:
157149 overwrite : true
158150 prerelease : false
159151 repo_token : ${{ secrets.GITHUB_TOKEN }}
160- file : aspect-model-editor-runtime/target/ame-backend!(*.txt) -linux
152+ file : aspect-model-editor-runtime/target/ame-backend-${{ github.event.inputs.release_version }} -linux
161153 tag : v${{ github.event.inputs.release_version }}
162154
163155 - name : Create GitHub pre-release (Linux)
@@ -168,54 +160,56 @@ jobs:
168160 overwrite : true
169161 prerelease : true
170162 repo_token : ${{ secrets.GITHUB_TOKEN }}
171- file : aspect-model-editor-runtime/target/ame-backend!(*.txt) -linux
163+ file : aspect-model-editor-runtime/target/ame-backend-${{ github.event.inputs.release_version }} -linux
172164 tag : v${{ github.event.inputs.release_version }}
173165
174- - name : Setup Git
175- run : |
176- git config user.name github-actions
177- git config user.email [email protected] 166+ release :
167+ needs : build
168+ runs-on : ubuntu-latest
169+ steps :
170+ - name : Checkout project
171+ uses : actions/checkout@v3
178172
179- # Sign Windows executable
180- - name : Get Artifact ID (Windows)
181- if : matrix.os == 'windows-latest'
173+ # Sign (Windows & Mac) executable
174+ - name : Get Artifact ID (Windows & Mac)
182175 shell : bash
183176 run : |
184177 # Get the list of artifacts for the specified workflow run
185178 response=$(curl -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.github+json" "https://api.github.com/repos/${{ github.repository_owner }}/$(echo '${{ github.repository }}' | cut -d'/' -f2)/actions/runs/${{ github.run_id }}/artifacts")
186179
187- # Filter out the ID of the artifact with a name that contains "windows"
188- artifact_id=$(echo "$response" | jq -r '.artifacts[] | select(.name | contains("win")) | .id')
180+ # Filter out the ID of the artifacts
181+ artifact_id_win=$(echo "$response" | jq -r '.artifacts[] | select(.name | contains("win")) | .id')
182+ artifact_id_mac=$(echo "$response" | jq -r '.artifacts[] | select(.name | contains("mac")) | .id')
189183
190184 # Save the artifact ID in an environment variable
191- echo "ARTIFACT_ID=$artifact_id" >> $GITHUB_ENV
185+ echo "ARTIFACT_ID_WIN=$artifact_id_win" >> $GITHUB_ENV
186+ echo "ARTIFACT_ID_MAC=$artifact_id_mac" >> $GITHUB_ENV
192187 env :
193188 TOKEN : ${{ secrets.GITHUB_TOKEN }}
194189
195- - name : Commit Artifact url and version changes and push to pre release branch for jenkins (Windows)
196- if : matrix.os == 'windows-latest'
190+ - name : Commit Artifact url and version changes and push to pre release branch for jenkins (Windows & Mac)
197191 shell : bash
198192 run : |
199- ARTIFACT_URL_WIN="https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/actions/artifacts/$ARTIFACT_ID/zip"
193+ ARTIFACT_URL_WIN="https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/actions/artifacts/$ARTIFACT_ID_WIN/zip"
194+ ARTIFACT_URL_MAC="https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/actions/artifacts/$ARTIFACT_ID_MAC/zip"
200195 BRANCH_NAME="pre_release_configuration"
201196
202197 echo "artifact_url_win=$ARTIFACT_URL_WIN" > parameters.txt
198+ echo "artifact_url_mac=$ARTIFACT_URL_MAC" >> parameters.txt
203199 echo "version=${{ github.event.inputs.release_version }}" >> parameters.txt
204200
205201 git config --global user.email "[email protected] " 206202 git config --global user.name "github-actions"
207203 git checkout -b $BRANCH_NAME
208204 git add parameters.txt
209- git commit -m "Add parameters.txt with artifact_url_win and version"
205+ git commit -m "Add parameters.txt with artifact_url_win, artifact_url_mac and version"
210206 git push origin $BRANCH_NAME
211207 env :
212208 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
213209
214210 - name : Trigger Jenkins Job, for signing executable
215- if : matrix.os == 'windows-latest'
216211 shell : bash
217212 run : |
218213 DATA='{"repository": {"url": "https://github.com/eclipse-esmf/esmf-aspect-model-editor-backend", "html_url": "https://github.com/eclipse-esmf/esmf-aspect-model-editor-backend", "owner": { "name": "ESMF"}}, "pusher": { "name": "GitHub Action", "email": "[email protected] "}}' 219214 SHA1="$(echo -n "${DATA}" | openssl dgst -sha1 -hmac "${WEBHOOK_SECRET}" | sed 's/SHA1(stdin)= //')"
220215 curl -X POST https://ci.eclipse.org/esmf/github-webhook/ -H "Content-Type: application/json" -H "X-GitHub-Event: push" -H "X-Hub-Signature: sha1=${SHA1}" -d "${DATA}"
221-
0 commit comments