From 70d42c05814547d8e5c8ac403e640fd3ef5245ac Mon Sep 17 00:00:00 2001 From: Nils Krehl Date: Wed, 13 Dec 2023 21:38:42 +0100 Subject: [PATCH 1/3] publish cicd pipeline for creating github releases --- .github/workflows/publish.yaml | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..6b349576 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,64 @@ +name: Publish + +on: + push: + branches: + - "*" #main + tags: + - "*" + # TODO: ensure semver style - "[0-9]+.[0-9]+.[0-9]+(-[a-z]+)?(.[0-9]+)?" + +jobs: + # call-tests_and_code_quality: + # if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + # uses: "./.github/workflows/tests_and_code_quality.yaml" + + build_and_deploy_artifact: + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + # needs: call-tests_and_code_quality + runs-on: ubuntu-latest + env: + PYTHON_VERSION: 3.9 + # environment: + # name: release + # url: https://upload.pypi.org/legacy/ + permissions: + id-token: write + contents: write + steps: + #---------------------------------------------- + # check-out repo and set-up python and poetry + #---------------------------------------------- + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Setup Python and Poetry + uses: biocypher/biocypher/.github/actions/setup + #---------------------------------------------- + # install dependencies + #---------------------------------------------- + - name: Install dependencies + uses: biocypher/biocypher/.github/actions/install + #---------------------------------------------- + # build artifact + #---------------------------------------------- + # - name: Build artifact + # run: poetry build + #---------------------------------------------- + # upload to PyPi + #---------------------------------------------- + #- name: Publish artifact to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # repository-url: https://upload.pypi.org/legacy/ + #---------------------------------------------- + # create Github release + #---------------------------------------------- + - name: Create Github release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} + run: | + gh release create "$tag" \ + --repo="$GITHUB_REPOSITORY" \ + --title="$tag" \ + --generate-notes From 3e09b918f5fde63051370e28c59b389e815141dc Mon Sep 17 00:00:00 2001 From: Nils Krehl Date: Wed, 13 Dec 2023 21:46:51 +0100 Subject: [PATCH 2/3] composite action reference --- .github/workflows/publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 6b349576..6fd2a2c1 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -32,12 +32,12 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - name: Setup Python and Poetry - uses: biocypher/biocypher/.github/actions/setup + uses: biocypher/biocypher/.github/actions/setup@main #---------------------------------------------- # install dependencies #---------------------------------------------- - name: Install dependencies - uses: biocypher/biocypher/.github/actions/install + uses: biocypher/biocypher/.github/actions/install@main #---------------------------------------------- # build artifact #---------------------------------------------- From 100984804017b46413e5692f72b0b65c88dae08e Mon Sep 17 00:00:00 2001 From: Nils Krehl Date: Wed, 13 Dec 2023 21:49:58 +0100 Subject: [PATCH 3/3] create github release when tag is set on main --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 6fd2a2c1..6871022c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,7 +3,7 @@ name: Publish on: push: branches: - - "*" #main + - main tags: - "*" # TODO: ensure semver style - "[0-9]+.[0-9]+.[0-9]+(-[a-z]+)?(.[0-9]+)?"