Skip to content

Commit

Permalink
Merge pull request #195 from MannLabs/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
mschwoer authored May 29, 2024
2 parents 5c612cb + 616a0d8 commit 6b33e19
Show file tree
Hide file tree
Showing 39 changed files with 325 additions and 119 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,52 @@
on:
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
commit_to_release:
description: 'Enter commit hash to release (example: 1a2b3c4)'
required: true
tag_to_release:
description: 'Enter tag to release (example: v1.5.5)'
required: true

name: Release bundled installer

name: Create Draft Release

jobs:
Version_Bumped:
Get_New_Version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.master_version_bumped.outputs.version }}
new_version: ${{ steps.get_new_release_tag.outputs.new_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Master version bumped
id: master_version_bumped
ref: ${{ inputs.commit_to_release }}

- name: Check release tag
shell: bash -l {0}
run: |
cd misc
. ./check_version.sh
echo "version=$current_version" >> $GITHUB_OUTPUT
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_On_GitHub:
Create_Draft_Release:
runs-on: ubuntu-latest
needs: Version_Bumped
needs: Get_New_Version
outputs:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
steps:
Expand All @@ -38,13 +58,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.Version_Bumped.outputs.version }}
release_name: v${{ needs.Version_Bumped.outputs.version }}
tag_name: ${{ inputs.tag_to_release }}
release_name: ${{ inputs.tag_to_release }}
draft: true
prerelease: false

Create_MacOS_Installer:
needs: [Create_Draft_On_GitHub, Version_Bumped]
needs: [Create_Draft_Release, Get_New_Version]
env:
ARCH: x64
EAGER_IMPORT: true
Expand Down Expand Up @@ -101,13 +121,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }}
asset_path: dist/alphadia-${{ needs.Version_Bumped.outputs.version }}-darwin-${{ env.ARCH }}.pkg
asset_name: alphadia-${{ needs.Version_Bumped.outputs.version }}-darwin-${{ env.ARCH }}.pkg
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_On_GitHub, Version_Bumped]
needs: [Create_Draft_Release, Get_New_Version]
env:
ARCH: x64
runs-on: windows-latest
Expand Down Expand Up @@ -169,7 +189,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }}
asset_path: dist/alphadia-${{ needs.Version_Bumped.outputs.version }}-win-${{ env.ARCH }}.exe
asset_name: alphadia-${{ needs.Version_Bumped.outputs.version }}-win-${{ env.ARCH }}.exe
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
end2end_testing:
name: End to end test
runs-on: self-hosted
if: contains(github.event.pull_request.labels.*.name, 'test:e2e')
if: contains(github.event.pull_request.labels.*.name, 'test:e2e') || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
strategy:
matrix:
# test case name as defined in e2e_test_cases.yaml
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/fdr_performance.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
on:
pull_request:
types: [ labeled ]
push:
branches: [ main, development ]
workflow_dispatch:

Expand All @@ -11,6 +13,7 @@ concurrency:

jobs:
fdr_performance_testing:
if: contains(github.event.pull_request.labels.*.name, 'test:fdr') || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
name: FDR performance testing
runs-on: AlphaDIA
env: # Or as an environment variable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
- 'alpha'
workflow_dispatch:

name: performance testing
name: Performance test

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pip_installation.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
on:
pull_request:
branches:
workflow_dispatch:

name: Default installation and tests
name: Perform installation and run tests

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
name: Publish Docker image

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

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag_to_release }}
- name: Get current version
id: get_current_version
shell: bash -l {0}
run: |
CURRENT_VERSION=$(./misc/get_current_version.sh)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: mannlabs/alphadia

- name: show metadata
run: |
echo "${{ steps.meta.outputs.tags }}"
echo "${{ steps.meta.outputs.labels }}"
echo "${{ steps.meta.outputs }}"
- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/alphadia:latest,
${{ secrets.DOCKER_USERNAME }}/alphadia:${{ steps.get_current_version.outputs.current_version }}
labels: ${{ steps.meta.outputs.labels }}


# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true
66 changes: 66 additions & 0 deletions .github/workflows/publish_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
name: Publish Docker image

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

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag_to_release }}
- name: Get current version
id: get_current_version
shell: bash -l {0}
run: |
CURRENT_VERSION=$(./misc/get_current_version.sh)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: mannlabs/alphadia

- name: show metadata
run: |
echo "${{ steps.meta.outputs.tags }}"
echo "${{ steps.meta.outputs.labels }}"
echo "${{ steps.meta.outputs }}"
- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/alphadia:latest,
${{ secrets.DOCKER_USERNAME }}/alphadia:${{ steps.get_current_version.outputs.current_version }}
labels: ${{ steps.meta.outputs.labels }}


# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true
16 changes: 12 additions & 4 deletions .github/workflows/publish_on_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ env:
jobs:
Create_PyPi_Release:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.get_current_version.outputs.new_version }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -25,6 +27,12 @@ jobs:
- name: Conda info
shell: bash -le {0}
run: conda info
- name: Get current version
id: get_current_version
shell: bash -l {0}
run: |
CURRENT_VERSION=$(misc/get_current_version.sh)
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ~/.cache/pip
Expand Down Expand Up @@ -53,7 +61,7 @@ jobs:
run: |
conda create -n pip_loose_test python=${{ env.PYTHON_VERSION }} -y
conda activate pip_loose_test
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "alphadia"
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "alphadia==${{ steps.get_current_version.outputs.new_version }}"
alphadia -v
conda deactivate
conda env remove --name pip_stable_test -y
Expand All @@ -62,7 +70,7 @@ jobs:
run: |
conda create -n pip_stable_test python=${{ env.PYTHON_VERSION }} -y
conda activate pip_stable_test
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "alphadia[stable]"
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "alphadia[stable]==${{ steps.get_current_version.outputs.new_version }}"
alphadia -v
conda deactivate
conda env remove --name pip_stable_test -y
Expand Down Expand Up @@ -97,7 +105,7 @@ jobs:
run: |
conda create -n pip_stable python=${{ env.PYTHON_VERSION }} -y
conda activate pip_stable
pip install "alphadia[stable]"
pip install "alphadia[stable]==${{ needs.Create_PyPi_Release.outputs.new_version }}"
alphadia -v
conda deactivate
conda env remove --name pip_stable -y
Expand All @@ -106,7 +114,7 @@ jobs:
run: |
conda create -n pip_loose python=${{ env.PYTHON_VERSION }} -y
conda activate pip_loose
pip install alphadia
pip install alphadia==${{ needs.Create_PyPi_Release.outputs.new_version }}"
alphadia -v
conda deactivate
conda env remove --name pip_loose -y
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,9 @@ gui/out/
# mono crash logs #
###################
mono_crash*

###################
# IDEs #
###################
.idea
.vscode
15 changes: 15 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.9"

# Build from the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Explicitly set the version of Python and its requirements
python:
install:
- requirements: requirements/requirements_docs.txt
14 changes: 0 additions & 14 deletions .vscode/settings.json

This file was deleted.

Loading

0 comments on commit 6b33e19

Please sign in to comment.