Skip to content

Commit

Permalink
Merge pull request #149 from Srajald/add-installer-to-release
Browse files Browse the repository at this point in the history
Add installer to release asset issue - #139
  • Loading branch information
t0mdavid-m authored Mar 7, 2025
2 parents 85fc9c3 + c03f4e6 commit 75fa783
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,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 @@ -186,6 +188,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 @@ -419,3 +429,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
2 changes: 1 addition & 1 deletion settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"online_deployment": false,
"enable_workspaces": true,
"test": true
}
}

0 comments on commit 75fa783

Please sign in to comment.