From 25ab0c5198a7a8bcc26ce62b5293e44163d063fa Mon Sep 17 00:00:00 2001 From: Jaspar S Date: Mon, 9 Jan 2023 09:13:03 +0100 Subject: [PATCH] Change: Use action for release Workflow --- .github/workflows/release-pontos-manually.yml | 66 ++++--------------- 1 file changed, 12 insertions(+), 54 deletions(-) diff --git a/.github/workflows/release-pontos-manually.yml b/.github/workflows/release-pontos-manually.yml index 178658727..dbf512a7a 100644 --- a/.github/workflows/release-pontos-manually.yml +++ b/.github/workflows/release-pontos-manually.yml @@ -10,59 +10,17 @@ on: jobs: build-and-release: - env: - GITHUB_USER: ${{ secrets.GREENBONE_BOT }} - GITHUB_MAIL: ${{ secrets.GREENBONE_BOT_MAIL }} - GITHUB_TOKEN: ${{ secrets.GREENBONE_BOT_TOKEN }} - GPG_KEY: ${{ secrets.GPG_KEY }} - GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} name: Build and release with pontos - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Install pontos - run: | - apt-get update && apt-get --assume-yes install python3-venv - python3 -m venv .venv - . .venv/bin/activate - python -m pip install --upgrade pip - python -m pip install --upgrade pontos - - name: Tell git who I am - run: | - git config --global user.name "${{ env.GITHUB_USER }}" - git config --global user.email "${{ env.GITHUB_MAIL }}" - git remote set-url origin https://${{ env.GITHUB_TOKEN }}@github.com/${{ github.repository }} - - name: Print base branch - # we always should've checked out the correct branch' - run: echo "Current Branch is $GITHUB_BASE_REF" - - name: Prepare patch release with pontos - run: | - . .venv/bin/activate - pontos-release prepare --patch -CC - - name: Release with pontos - run: | - . .venv/bin/activate - pontos-release release -CC - - name: Import key from secrets - run: | - echo -e "${{ env.GPG_KEY }}" >> tmp.file - gpg \ - --pinentry-mode loopback \ - --passphrase ${{ env.GPG_PASSPHRASE }} \ - --import tmp.file - rm tmp.file - - name: Sign with pontos-release sign - run: | - echo "Signing assets for ${{env.VERSION}}" - . .venv/bin/activate - pontos-release sign \ - --signing-key ${{ env.GPG_FINGERPRINT }} \ - --passphrase ${{ env.GPG_PASSPHRASE }} \ - --release-version ${{ env.VERSION }} \ No newline at end of file + - name: Release with release action + uses: greenbone/actions/release@v2 + with: + conventional-commits: true + ref: ${{ github.event.inputs.branch }} + github-user: ${{ secrets.GREENBONE_BOT }} + github-user-mail: ${{ secrets.GREENBONE_BOT_MAIL }} + github-user-token: ${{ secrets.GREENBONE_BOT_TOKEN }} + gpg-key: ${{ secrets.GPG_KEY }} + gpg-fingerprint: ${{ secrets.GPG_FINGERPRINT }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}