-
Notifications
You must be signed in to change notification settings - Fork 7
207 lines (202 loc) · 10.7 KB
/
sign_executable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: "Sign Executable"
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
jobs:
gh_tagged_release:
name: Create tagged release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04 ]
steps:
# - name: Checkout project
# uses: actions/checkout@v3
#
# - name: Setup Git
# run: |
# git config user.name github-actions
# git config user.email [email protected]
#
# - name: Cache node modules
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
#
# - name: Setup NodeJs
# uses: actions/setup-node@v3
# with:
# node-version: '20'
# cache: 'npm'
# cache-dependency-path: '**/package-lock.json'
#
# - name: Set versions
# if: matrix.os == 'ubuntu-20.04'
# run: |
# release_version=${{ github.event.inputs.release_version }}
# release_branch_name=${release_version%.*}.x
# echo "release_branch_name=$release_branch_name" >> $GITHUB_ENV
#
# - name: Get glibc version
# if: matrix.os == 'ubuntu-20.04'
# run: |
# version=$(ldd --version | head -n 1 | awk '{print $NF}')
# echo "GLIBC_VERSION=$version" >> $GITHUB_ENV
# echo "::set-output name=glibc_version::$version"
#
# - name: Set antora version
# if: matrix.os == 'ubuntu-20.04'
# run: yq eval -i '.version = "${{ github.event.inputs.release_version }}"' documentation/ame-guide/antora.yml
#
## - name: Commit version changes and push to upstream repository
## if: matrix.os == 'ubuntu-20.04'
## run: |
## git config --global user.email "[email protected]"
## git config --global user.name "github-actions"
## git checkout -b ${{ env.release_branch_name }}
## git add documentation/ame-guide/antora.yml
## git commit -m "Set version to ${{ github.event.inputs.release_version }}"
## git push origin ${{ env.release_branch_name }}
## git tag v${{ github.event.inputs.release_version }}
## git push origin v${{ github.event.inputs.release_version }}
#
# - name: Download aspect model service into project (Mac)
# if: matrix.os == 'macos-latest'
# run: |
# mkdir backend
#
# ASSET_ONE_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq '.assets[0].browser_download_url')
# ASSET_TWO_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq '.assets[1].browser_download_url')
# ASSET_THREE_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq '.assets[2].browser_download_url')
#
# if [[ ${ASSET_ONE_URL} == *"-mac"* ]];
# then
# echo $ASSET_ONE_URL
# DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq -r '.assets[0].url')
# fi
#
# if [[ ${ASSET_TWO_URL} == *"-mac"* ]];
# then
# echo $ASSET_TWO_URL
# DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq -r '.assets[1].url')
# fi
#
# if [[ ${ASSET_THREE_URL} == *"-mac"* ]];
# then
# echo ASSET_THREE_URL
# DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq -r '.assets[2].url')
# fi
#
# curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $DOWNLOAD_URL > backend/ame-backend.sh
# chmod 755 backend/ame-backend.sh
#
# - name: Download aspect model service into project (Linux)
# if: matrix.os == 'ubuntu-20.04'
# run: |
# mkdir backend
#
# ASSET_ONE_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq '.assets[0].browser_download_url')
# ASSET_TWO_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq '.assets[1].browser_download_url')
# ASSET_THREE_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq '.assets[2].browser_download_url')
#
# if [[ ${ASSET_ONE_URL} == *"-linux"* ]];
# then
# echo $ASSET_ONE_URL
# DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq -r '.assets[0].url')
# fi
#
# if [[ ${ASSET_TWO_URL} == *"-linux"* ]];
# then
# echo $ASSET_TWO_URL
# DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq -r '.assets[1].url')
# fi
#
# if [[ ${ASSET_THREE_URL} == *"-linux"* ]];
# then
# echo ASSET_THREE_URL
# DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq -r '.assets[2].url')
# fi
#
# curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $DOWNLOAD_URL > backend/ame-backend.sh
# chmod 755 backend/ame-backend.sh
#
# - name: Download aspect model service into project (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# mkdir backend
#
# $RESPONSE=$(curl.exe -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }})
# $RESPONSE_JSON=($RESPONSE | ConvertFrom-Json)
#
# if ($RESPONSE_JSON.assets[0].browser_download_url -match ".exe") {
# echo $RESPONSE_JSON.assets[0].browser_download_url
# curl.exe -sL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $RESPONSE_JSON.assets[0].url -o backend/ame-backend.exe
# } elseif ($RESPONSE_JSON.assets[1].browser_download_url -match ".exe") {
# echo $RESPONSE_JSON.assets[1].browser_download_url
# curl.exe -sL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $RESPONSE_JSON.assets[1].url -o backend/ame-backend.exe
# } elseif ($RESPONSE_JSON.assets[2].browser_download_url -match ".exe") {
# echo $RESPONSE_JSON.assets[2].browser_download_url
# curl.exe -sL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $RESPONSE_JSON.assets[2].url -o backend/ame-backend.exe
# }
#
# - name: Install node modules
# run: npm install
# working-directory: core
#
# - name: Set app version (Unix)
# if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-20.04'
# run: npm version ${{ github.event.inputs.release_version }}
# working-directory: core
#
# - name: Set app version (Windows)
# if: matrix.os == 'windows-latest'
# run: npm version ${{ github.event.inputs.release_version }}
# working-directory: core
#
# - name: Build electron app (Mac)
# if: matrix.os == 'macos-latest'
# run: npm run build:mac:prod
# working-directory: core
#
# - name: Build electron app (Linux)
# if: matrix.os == 'ubuntu-20.04'
# run: |
# npm run build:linux:prod
# mv electron/aspect-model-editor-v${{ github.event.inputs.release_version }}-linux.tar.gz electron/aspect-model-editor-v${{ github.event.inputs.release_version }}-linux-glibc-v${{ env.GLIBC_VERSION }}.tar.gz
# working-directory: core
#
# - name: Build electron app (Windows)
# if: matrix.os == 'windows-latest'
# run: npm run build:win:prod
# working-directory: core
#
# - name: Create Windows installer
# if: matrix.os == 'windows-latest'
# uses: joncloud/[email protected]
# with:
# script-file: win-installer/installer.nsi
# arguments: "-V3 -DVERSION=${{ github.event.inputs.release_version }}"
#
# - name: Convert DMG to ZIP
# run: |
# dmgFileName="yourfile.dmg"
# zipFileName="${dmgFileName%.dmg}.zip"
# hdiutil convert "$dmgFileName" -format UDTO -o temp.cdr
# mv temp.cdr temp.iso
# zip -r "$zipFileName" temp.iso
# rm temp.iso
# echo "$zipFileName erstellt."
- name: Trigger Jenkins Job, for singing executable
run: |
DATA='{"repository": {"url": "https://github.com/eclipse-esmf/esmf-aspect-model-editor", "html_url": "https://github.com/eclipse-esmf/esmf-aspect-model-editor", "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}"