From c585eeeb52c8e00e038d0f63f3bad99729f71073 Mon Sep 17 00:00:00 2001 From: Claas Date: Wed, 10 Jan 2024 10:33:14 +0100 Subject: [PATCH] GitHub workflows: Added publish_release.yml workflow --- .github/workflows/_merge_into_release.yml | 25 +++++++++++++++++++ .../workflows/_publish_package.yml.disabled | 22 ++++++++++++++++ .github/workflows/publish_release.yml | 25 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 .github/workflows/_merge_into_release.yml create mode 100644 .github/workflows/_publish_package.yml.disabled create mode 100644 .github/workflows/publish_release.yml diff --git a/.github/workflows/_merge_into_release.yml b/.github/workflows/_merge_into_release.yml new file mode 100644 index 0000000..cec3964 --- /dev/null +++ b/.github/workflows/_merge_into_release.yml @@ -0,0 +1,25 @@ +name: Merge into release + +on: + workflow_call: + secrets: + RELEASE_TOKEN: + required: true + +jobs: + merge_into_release: + name: Merge ${{ github.event.ref }} -> release branch + runs-on: ubuntu-latest + environment: release + steps: + - uses: actions/checkout@v4 + with: + # Fetch the whole history to prevent unrelated history errors + fetch-depth: 0 + # The branch you want to checkout (usually equal to `branchtomerge`) + # ref: ${{ github.event.ref }} + - uses: devmasx/merge-branch@v1.4.0 + with: + type: now + target_branch: release + github_token: ${{ secrets.RELEASE_TOKEN }} diff --git a/.github/workflows/_publish_package.yml.disabled b/.github/workflows/_publish_package.yml.disabled new file mode 100644 index 0000000..fe0b5b6 --- /dev/null +++ b/.github/workflows/_publish_package.yml.disabled @@ -0,0 +1,22 @@ +name: Publish Package to pypi + +on: + workflow_call: + secrets: + PYPI_API_TOKEN: + required: true + +jobs: + publish: + name: Publish package + runs-on: ubuntu-latest + environment: pypi + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: ./dist/ + - uses: pypa/gh-action-pypi-publish@v1.5.2 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml new file mode 100644 index 0000000..faffd92 --- /dev/null +++ b/.github/workflows/publish_release.yml @@ -0,0 +1,25 @@ +name: Publish Release +run-name: Publish Release ${{ github.event.ref }} created by @${{ github.actor }} + +on: + push: + tags: + - v* + +jobs: + # requirements_files: + # uses: ./.github/workflows/_requirements_files.yml + # build_package: + # needs: + # - requirements_files + # uses: ./.github/workflows/_build_package.yml + # publish_package: + # needs: + # - build_package + # uses: ./.github/workflows/_publish_package.yml + # secrets: + # PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + merge_into_release: + uses: ./.github/workflows/_merge_into_release.yml + secrets: + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}