Skip to content

Commit

Permalink
Merge pull request #344 from MannLabs/development
Browse files Browse the repository at this point in the history
Release 1.8.0
  • Loading branch information
GeorgWa authored Sep 11, 2024
2 parents 6e27ebc + c2873da commit 00584f5
Show file tree
Hide file tree
Showing 90 changed files with 5,893 additions and 1,503 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/branch-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ jobs:
name: Run all pre-commit hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]

# For feature branches, we don't test the full matrix (os x [stable, loose]) in order to save time & resources.
run-tests-stable:
name: Test stable pip installation on ubuntu-latest
Expand All @@ -25,3 +26,13 @@ jobs:
os: ${{ matrix.os }}
install-script: ./pip_install.sh stable,test
test-script: ./run_unit_tests.sh

get-code-review-input:
runs-on: ubuntu-latest
steps:
- uses: MannLabs/alphashared/actions/get-code-review-input@v1
continue-on-error: true
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
EXCLUDED_EXTENSIONS: ipynb;js
212 changes: 17 additions & 195 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -1,200 +1,22 @@
# Create a draft release and build and upload all installers to it.
name: Create Release

on:
workflow_dispatch:
inputs:
commit_to_release:
description: 'Enter commit hash to release (example: ef4037cb571f99cb4919b520fde7174972aae473)'
required: true
tag_to_release:
description: 'Enter tag to release (example: v1.5.5)'
required: true


name: Create Draft Release
commitish_to_release:
type: string
description: 'Enter commit hash or branch to release (default: main).'
default: "main"

jobs:
Get_New_Version:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.check_release_tag.outputs.new_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_to_release }}

- name: Check release tag
id: check_release_tag
shell: bash -le {0}
run: |
CURRENT_VERSION=$(./misc/get_current_version.sh)
if [ "v${CURRENT_VERSION}" != "${{ inputs.tag_to_release }}" ]; then
echo Code version "v${CURRENT_VERSION}" does not match the tag to release ${{ inputs.tag_to_release }}
exit 1
fi
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
- uses: mukunku/[email protected]
id: check-tag
with:
tag: ${{ inputs.tag_to_release }}

- name: Check if tag already exists
run: |
echo "Tag already exists!"
exit 1
if: steps.check-tag.outputs.exists == 'true'


Create_Draft_Release:
runs-on: ubuntu-latest
needs: Get_New_Version
outputs:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
steps:
- name: Draft Release
id: draft_release
# TODO this action is deprecated, replace with https://github.com/ncipollo/release-action
# cf. https://github.com/actions/create-release/issues/119#issuecomment-783010321
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.tag_to_release }}
release_name: ${{ inputs.tag_to_release }}
draft: true
prerelease: false

Create_MacOS_Installer:
needs: [Create_Draft_Release, Get_New_Version]
env:
ARCH: x64
EAGER_IMPORT: true
runs-on: macos-latest-xlarge
steps:
- name : Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_to_release }}

# Build backend
- name: Install conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
activate-environment: alpha
python-version: "3.11"

- name: Check arm64
shell: bash -el {0}
run: |
python -c "import platform; print(platform.machine())"
- name: Build backend
shell: bash -el {0}
run: |
release/macos/build_backend_macos.sh
- name: Test backend
shell: bash -el {0}
run: |
dist/alphadia/alphadia --version
# Build GUI
- name: Setup Node.js
uses: actions/setup-node@v4

- name: Build GUI
run: |
release/macos/build_gui_macos.sh
# combine backend and GUI
- name: Build package
shell: bash -el {0}
run: |
release/macos/build_pkg_macos.sh
- name: List output files
run: |
ls dist
# Upload the package
- name: Upload a Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.Create_Draft_Release.outputs.upload_url }}
asset_path: dist/alphadia-${{ needs.Get_New_Version.outputs.new_version }}-darwin-${{ env.ARCH }}.pkg
asset_name: alphadia-${{ needs.Get_New_Version.outputs.new_version }}-darwin-${{ env.ARCH }}.pkg
asset_content_type: application/zip

Create_Windows_Installer:
needs: [Create_Draft_Release, Get_New_Version]
env:
ARCH: x64
runs-on: windows-latest
steps:
- name : Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_to_release }}

# Build backend
- name: Install conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
activate-environment: alpha
python-version: "3.11"

- name: Build Backend
shell: powershell
run: |
release/windows/build_backend.ps1
- name: Test Backend
shell: powershell
run: |
dist\alphadia\alphadia.exe --version
# Build GUI
- name: Setup Node.js
uses: actions/setup-node@v4

- name: Build GUI
shell: powershell
run: |
release/windows/build_gui.ps1
# combine backend and GUI
- name: Check if Innosetup is installed
shell: powershell
run: |
if (-not (Test-Path "C:\Program Files (x86)\Inno Setup 6\ISCC.exe")) {
Write-Host "Inno Setup is not installed"
exit 1
}
else {
Write-Host "Inno Setup is installed"
}
- name: Build Installer
shell: powershell
run: |
release/windows/build_installer.ps1
- name: List output files
run: |
ls dist
- name: Upload a Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.Create_Draft_Release.outputs.upload_url }}
asset_path: dist/alphadia-${{ needs.Get_New_Version.outputs.new_version }}-win-${{ env.ARCH }}.exe
asset_name: alphadia-${{ needs.Get_New_Version.outputs.new_version }}-win-${{ env.ARCH }}.exe
asset_content_type: application/zip
create-release:
uses: MannLabs/alphashared/.github/workflows/create_release.yml@v1
secrets: inherit
permissions:
contents: write
with:
package_name: alphadia
commitish_to_release: ${{ inputs.commitish_to_release }}
build_nodejs_ui: true
test_app: false
5 changes: 3 additions & 2 deletions .github/workflows/e2e_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
# test case name as defined in e2e_test_cases.yaml
test_case: [ "basic", "synchropasef", "astral", ]
test_case: [ "basic", "synchropasef", "astral", "astral_automatic_calibration", ]
env:
RUN_NAME: alphadia-${{github.sha}}-${{github.run_id}}-${{github.run_attempt}}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
Expand All @@ -24,6 +24,7 @@ jobs:
NUMBA_BOUNDSCHECK: 1
NUMBA_DEVELOPER_MODE: 1
NUMBA_FULL_TRACEBACKS: 1
TQDM_MININTERVAL: 10 # avoid lots of tqdm outputs
steps:
- uses: actions/checkout@v4
- name: Conda info
Expand All @@ -39,7 +40,7 @@ jobs:
shell: bash -el {0}
run: |
cd tests
. ./run_e2e_tests.sh ${{ matrix.test_case }} $RUN_NAME ${GITHUB_SHA::7} $BRANCH_NAME
. ./run_e2e_tests.sh ${{ matrix.test_case }} $RUN_NAME True ${GITHUB_SHA::7} $BRANCH_NAME
- name: Cleanup
if: always()
shell: bash -el {0}
Expand Down
Loading

0 comments on commit 00584f5

Please sign in to comment.