Skip to content

Commit 75fa783

Browse files
authored
Merge pull request #149 from Srajald/add-installer-to-release
Add installer to release asset issue - #139
2 parents 85fc9c3 + c03f4e6 commit 75fa783

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed

.github/workflows/build-windows-executable-app-with-pyinstaller.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,11 @@ jobs:
281281
with:
282282
name: OpenMS-App
283283
path: dist
284+
285+
- name: Upload Artifact as Release Asset
286+
if: github.event_name == 'release'
287+
uses: softprops/action-gh-release@v2
288+
with:
289+
files: OpenMS-App.zip
290+
env:
291+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-windows-executable-app.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
branches: [ "main" ]
55
pull_request:
66
branches: [ "main" ]
7+
release:
8+
types: [created]
79
workflow_dispatch:
810

911
env:
@@ -186,6 +188,14 @@ jobs:
186188
- name: Checkout
187189
uses: actions/checkout@v4
188190

191+
- name: Set Version in settings.json
192+
run: |
193+
$VERSION="${{ github.event.release.tag_name }}"
194+
$content = Get-Content -Raw settings.json | ConvertFrom-Json
195+
$content.version = $VERSION
196+
$content | ConvertTo-Json -Depth 100 | Set-Content settings.json
197+
198+
189199
- name: Download package as artifact
190200
uses: actions/download-artifact@v4
191201
with:
@@ -419,3 +429,11 @@ jobs:
419429
name: OpenMS-App
420430
path: |
421431
OpenMS-App.zip
432+
433+
- name: Upload Artifact as Release Asset
434+
if: github.event_name == 'release'
435+
uses: softprops/action-gh-release@v2
436+
with:
437+
files: OpenMS-App.zip
438+
env:
439+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,15 @@ RUN mamba run -n streamlit-env python hooks/hook-analytics.py
151151
# Set Online Deployment
152152
RUN jq '.online_deployment = true' settings.json > tmp.json && mv tmp.json settings.json
153153

154-
# Download latest OpenMS App executable for Windows from Github actions workflow.
154+
# Download latest OpenMS App executable as a ZIP file
155155
RUN if [ -n "$GH_TOKEN" ]; then \
156156
echo "GH_TOKEN is set, proceeding to download the release asset..."; \
157-
gh run download -R ${GITHUB_USER}/${GITHUB_REPO} $(gh run list -R ${GITHUB_USER}/${GITHUB_REPO} -b main -e push -s completed -w "Build executable for Windows" --json databaseId -q '.[0].databaseId') -n OpenMS-App --dir /app; \
157+
gh release download -R ${GITHUB_USER}/${GITHUB_REPO} -p "OpenMS-App.zip" -D /app; \
158158
else \
159159
echo "GH_TOKEN is not set, skipping the release asset download."; \
160160
fi
161161

162+
162163
# Run app as container entrypoint.
163164
EXPOSE $PORT
164165
ENTRYPOINT ["/app/entrypoint.sh"]

Dockerfile_simple

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ RUN mamba run -n streamlit-env python hooks/hook-analytics.py
9797
# Set Online Deployment
9898
RUN jq '.online_deployment = true' settings.json > tmp.json && mv tmp.json settings.json
9999

100-
# Download latest OpenMS App executable for Windows from Github actions workflow.
100+
# Download latest OpenMS App executable as a ZIP file
101101
RUN if [ -n "$GH_TOKEN" ]; then \
102102
echo "GH_TOKEN is set, proceeding to download the release asset..."; \
103-
gh run download -R ${GITHUB_USER}/${GITHUB_REPO} $(gh run list -R ${GITHUB_USER}/${GITHUB_REPO} -b main -e push -s completed -w "Build executable for Windows" --json databaseId -q '.[0].databaseId') -n OpenMS-App --dir /app; \
103+
gh release download -R ${GITHUB_USER}/${GITHUB_REPO} -p "OpenMS-App.zip" -D /app; \
104104
else \
105105
echo "GH_TOKEN is not set, skipping the release asset download."; \
106106
fi

settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
"online_deployment": false,
1717
"enable_workspaces": true,
1818
"test": true
19-
}
19+
}

0 commit comments

Comments
 (0)