Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add installer to release asset issue - #139 #149

Merged
merged 10 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,11 @@ jobs:
with:
name: OpenMS-App
path: dist

- name: Upload Artifact as Release Asset
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: OpenMS-App.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/build-windows-executable-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [created]
workflow_dispatch:

env:
Expand Down Expand Up @@ -175,6 +177,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set Version in settings.json
run: |
$VERSION="${{ github.event.release.tag_name }}"
$content = Get-Content -Raw settings.json | ConvertFrom-Json
$content.version = $VERSION
$content | ConvertTo-Json -Depth 100 | Set-Content settings.json


- name: Download package as artifact
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -408,3 +418,11 @@ jobs:
name: OpenMS-App
path: |
OpenMS-App.zip

- name: Upload Artifact as Release Asset
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: OpenMS-App.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ RUN mamba run -n streamlit-env python hooks/hook-analytics.py
# Set Online Deployment
RUN jq '.online_deployment = true' settings.json > tmp.json && mv tmp.json settings.json

# Download latest OpenMS App executable for Windows from Github actions workflow.
# Download latest OpenMS App executable as a ZIP file
RUN if [ -n "$GH_TOKEN" ]; then \
echo "GH_TOKEN is set, proceeding to download the release asset..."; \
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; \
gh release download -R ${GITHUB_USER}/${GITHUB_REPO} -p "OpenMS-App.zip" -D /app; \
else \
echo "GH_TOKEN is not set, skipping the release asset download."; \
fi


# Run app as container entrypoint.
EXPOSE $PORT
ENTRYPOINT ["/app/entrypoint.sh"]
4 changes: 2 additions & 2 deletions Dockerfile_simple
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ RUN mamba run -n streamlit-env python hooks/hook-analytics.py
# Set Online Deployment
RUN jq '.online_deployment = true' settings.json > tmp.json && mv tmp.json settings.json

# Download latest OpenMS App executable for Windows from Github actions workflow.
# Download latest OpenMS App executable as a ZIP file
RUN if [ -n "$GH_TOKEN" ]; then \
echo "GH_TOKEN is set, proceeding to download the release asset..."; \
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; \
gh release download -R ${GITHUB_USER}/${GITHUB_REPO} -p "OpenMS-App.zip" -D /app; \
else \
echo "GH_TOKEN is not set, skipping the release asset download."; \
fi
Expand Down
3 changes: 2 additions & 1 deletion settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"tag": "57690c44-d635-43b0-ab43-f8bd3064ca06"
}
},
"online_deployment": false
"online_deployment": false,
"version": "0.0.0"
}