-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add final changes for release workflow
- Loading branch information
Showing
3 changed files
with
34 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,55 +113,3 @@ jobs: | |
with: | ||
name: aspect-model-editor-vDEV-SNAPSHOT-mac | ||
path: aspect-model-editor-runtime/target/ame-backend-DEV-SNAPSHOT-mac | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
|
||
# Sign (Windows & Mac) executable | ||
- name: Get Artifact ID (Windows & Mac) | ||
shell: bash | ||
run: | | ||
# Get the list of artifacts for the specified workflow run | ||
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") | ||
# Filter out the ID of the artifacts | ||
artifact_id_win=$(echo "$response" | jq -r '.artifacts[] | select(.name | contains("win")) | .id') | ||
artifact_id_mac=$(echo "$response" | jq -r '.artifacts[] | select(.name | contains("mac")) | .id') | ||
# Save the artifact ID in an environment variable | ||
echo "ARTIFACT_ID_WIN=$artifact_id_win" >> $GITHUB_ENV | ||
echo "ARTIFACT_ID_MAC=$artifact_id_mac" >> $GITHUB_ENV | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Commit Artifact url and version changes and push to pre release branch for jenkins (Windows & Mac) | ||
shell: bash | ||
run: | | ||
ARTIFACT_URL_WIN="https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/actions/artifacts/$ARTIFACT_ID_WIN/zip" | ||
ARTIFACT_URL_MAC="https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/actions/artifacts/$ARTIFACT_ID_MAC/zip" | ||
BRANCH_NAME="pre_release_configuration" | ||
echo "artifact_url_win=$ARTIFACT_URL_WIN" > parameters.txt | ||
echo "artifact_url_mac=$ARTIFACT_URL_MAC" >> parameters.txt | ||
echo "version=DEV-SNAPSHOT" >> parameters.txt | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "github-actions" | ||
git checkout -b $BRANCH_NAME | ||
git add parameters.txt | ||
git commit -m "Add parameters.txt with artifact_url_win, artifact_url_mac and version" | ||
git push origin $BRANCH_NAME | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Trigger Jenkins Job, for signing executable | ||
shell: bash | ||
run: | | ||
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]"}}' | ||
SHA1="$(echo -n "${DATA}" | openssl dgst -sha1 -hmac "${WEBHOOK_SECRET}" | sed 's/SHA1(stdin)= //')" | ||
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}" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
required: true | ||
|
||
jobs: | ||
gh_tagged_release: | ||
build: | ||
name: Create tagged release | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
|
@@ -126,29 +126,21 @@ jobs: | |
aspect-model-editor-runtime/target/*.bat | ||
aspect-model-editor-runtime/target/lib/ | ||
# Release Mac and Linux executables | ||
- name: Create GitHub release (Mac) | ||
if: ${{ (matrix.os == 'macos-12') && (!contains( github.ref, '-M' )) }} | ||
uses: svenstaro/upload-release-action@latest | ||
- name: Upload binary (Mac) | ||
if: matrix.os == 'macos-12' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
file_glob: true | ||
overwrite: true | ||
prerelease: false | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: aspect-model-editor-runtime/target/ame-backend!(*.txt)-mac | ||
tag: v${{ github.event.inputs.release_version }} | ||
name: aspect-model-editor-v${{ github.event.inputs.release_version }}-mac | ||
path: aspect-model-editor-runtime/target/ame-backend-${{ github.event.inputs.release_version }}-mac | ||
|
||
- name: Create GitHub pre-release (Mac) | ||
if: ${{ (matrix.os == 'macos-12') && (contains( github.ref, '-M' )) }} | ||
uses: svenstaro/upload-release-action@latest | ||
- name: Upload binary (Linux) | ||
if: matrix.os == 'ubuntu-20.04' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
file_glob: true | ||
overwrite: true | ||
prerelease: true | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: aspect-model-editor-runtime/target/ame-backend!(*.txt)-mac | ||
tag: v${{ github.event.inputs.release_version }} | ||
name: aspect-model-editor-v${{ github.event.inputs.release_version }}-linux | ||
path: aspect-model-editor-runtime/target/ame-backend-${{ github.event.inputs.release_version }}-linux | ||
|
||
# Release Linux executables | ||
- name: Create GitHub release (Linux) | ||
if: ${{ (matrix.os == 'ubuntu-20.04') && (!contains( github.ref, '-M' )) }} | ||
uses: svenstaro/upload-release-action@latest | ||
|
@@ -157,7 +149,7 @@ jobs: | |
overwrite: true | ||
prerelease: false | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: aspect-model-editor-runtime/target/ame-backend!(*.txt)-linux | ||
file: aspect-model-editor-runtime/target/ame-backend-${{ github.event.inputs.release_version }}-linux | ||
tag: v${{ github.event.inputs.release_version }} | ||
|
||
- name: Create GitHub pre-release (Linux) | ||
|
@@ -168,51 +160,54 @@ jobs: | |
overwrite: true | ||
prerelease: true | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: aspect-model-editor-runtime/target/ame-backend!(*.txt)-linux | ||
file: aspect-model-editor-runtime/target/ame-backend-${{ github.event.inputs.release_version }}-linux | ||
tag: v${{ github.event.inputs.release_version }} | ||
|
||
- name: Setup Git | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
|
||
# Sign Windows executable | ||
- name: Get Artifact ID (Windows) | ||
if: matrix.os == 'windows-latest' | ||
# Sign (Windows & Mac) executable | ||
- name: Get Artifact ID (Windows & Mac) | ||
shell: bash | ||
run: | | ||
# Get the list of artifacts for the specified workflow run | ||
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") | ||
# Filter out the ID of the artifact with a name that contains "windows" | ||
artifact_id=$(echo "$response" | jq -r '.artifacts[] | select(.name | contains("win")) | .id') | ||
# Filter out the ID of the artifacts | ||
artifact_id_win=$(echo "$response" | jq -r '.artifacts[] | select(.name | contains("win")) | .id') | ||
artifact_id_mac=$(echo "$response" | jq -r '.artifacts[] | select(.name | contains("mac")) | .id') | ||
# Save the artifact ID in an environment variable | ||
echo "ARTIFACT_ID=$artifact_id" >> $GITHUB_ENV | ||
echo "ARTIFACT_ID_WIN=$artifact_id_win" >> $GITHUB_ENV | ||
echo "ARTIFACT_ID_MAC=$artifact_id_mac" >> $GITHUB_ENV | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Commit Artifact url and version changes and push to pre release branch for jenkins (Windows) | ||
if: matrix.os == 'windows-latest' | ||
- name: Commit Artifact url and version changes and push to pre release branch for jenkins (Windows & Mac) | ||
shell: bash | ||
run: | | ||
ARTIFACT_URL_WIN="https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/actions/artifacts/$ARTIFACT_ID/zip" | ||
ARTIFACT_URL_WIN="https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/actions/artifacts/$ARTIFACT_ID_WIN/zip" | ||
ARTIFACT_URL_MAC="https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/actions/artifacts/$ARTIFACT_ID_MAC/zip" | ||
BRANCH_NAME="pre_release_configuration" | ||
echo "artifact_url_win=$ARTIFACT_URL_WIN" > parameters.txt | ||
echo "artifact_url_mac=$ARTIFACT_URL_MAC" >> parameters.txt | ||
echo "version=${{ github.event.inputs.release_version }}" >> parameters.txt | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "github-actions" | ||
git checkout -b $BRANCH_NAME | ||
git add parameters.txt | ||
git commit -m "Add parameters.txt with artifact_url_win and version" | ||
git commit -m "Add parameters.txt with artifact_url_win, artifact_url_mac and version" | ||
git push origin $BRANCH_NAME | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Trigger Jenkins Job, for signing executable | ||
if: matrix.os == 'windows-latest' | ||
shell: bash | ||
run: | | ||
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]"}}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters