-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from MannLabs/development
Development
- Loading branch information
Showing
39 changed files
with
325 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.