From f9b627c1e404e09985b94b50519504990d4befa6 Mon Sep 17 00:00:00 2001 From: Halvor Holsten Strand Date: Sat, 28 Oct 2023 08:33:58 +0200 Subject: [PATCH] Added automatic release workflow, for use with GitHub Actions. --- .github/workflows/automatic-release.yml | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/automatic-release.yml diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml new file mode 100644 index 0000000..262f3c6 --- /dev/null +++ b/.github/workflows/automatic-release.yml @@ -0,0 +1,38 @@ +name: automatic-release + +on: + workflow_dispatch: + inputs: + release_type: + description: Release type + required: true + type: choice + options: + - patch + - minor + - major + +jobs: + release: + name: Release + runs-on: ubuntu-20.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup Git + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + - name: Install prerequisites + run: pip install -r release-requirements.txt + - name: Execute release + env: + SEMVER_BUMP: ${{ github.event.inputs.release_type }} + TWINE_REPOSITORY: ${{ vars.TWINE_REPOSITORY }} + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + run: ./release $SEMVER_BUMP