|
| 1 | +name: Manually release gvm-libs with pontos |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-and-release: |
| 8 | + env: |
| 9 | + GITHUB_USER: ${{ secrets.GREENBONE_BOT }} |
| 10 | + GITHUB_MAIL: ${{ secrets.GREENBONE_BOT_MAIL }} |
| 11 | + GITHUB_TOKEN: ${{ secrets.GREENBONE_BOT_TOKEN }} |
| 12 | + GPG_KEY: ${{ secrets.GPG_KEY }} |
| 13 | + GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} |
| 14 | + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
| 15 | + name: Build and release with pontos |
| 16 | + runs-on: 'ubuntu-latest' |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v2 |
| 19 | + with: |
| 20 | + persist-credentials: false |
| 21 | + - name: Set up Python |
| 22 | + uses: actions/setup-python@v2 |
| 23 | + with: |
| 24 | + python-version: 3.8 |
| 25 | + - name: Install pontos |
| 26 | + run: | |
| 27 | + apt-get update && apt-get --assume-yes install python3-venv |
| 28 | + python3 -m venv .venv |
| 29 | + . .venv/bin/activate |
| 30 | + python -m pip install --upgrade pip |
| 31 | + python -m pip install --upgrade pontos |
| 32 | + - name: Tell git who I am |
| 33 | + run: | |
| 34 | + git config --global user.name "${{ env.GITHUB_USER }}" |
| 35 | + git config --global user.email "${{ env.GITHUB_MAIL }}" |
| 36 | + git remote set-url origin https://${{ env.GITHUB_TOKEN }}@github.com/${{ github.repository }} |
| 37 | + - name: Print base branch |
| 38 | + # we always should've checked out the correct branch' |
| 39 | + run: echo "Current Branch is $GITHUB_BASE_REF" |
| 40 | + - name: Prepare patch release with pontos |
| 41 | + run: | |
| 42 | + . .venv/bin/activate |
| 43 | + pontos-release prepare --patch |
| 44 | + echo "VERSION=$(pontos-version show)" >> $GITHUB_ENV |
| 45 | + - name: Release with pontos |
| 46 | + run: | |
| 47 | + . .venv/bin/activate |
| 48 | + pontos-release release |
| 49 | + - name: Import key from secrets |
| 50 | + run: | |
| 51 | + echo -e "${{ env.GPG_KEY }}" >> tmp.file |
| 52 | + gpg \ |
| 53 | + --pinentry-mode loopback \ |
| 54 | + --passphrase ${{ env.GPG_PASSPHRASE }} \ |
| 55 | + --import tmp.file |
| 56 | + rm tmp.file |
| 57 | + - name: Sign with pontos-release sign |
| 58 | + run: | |
| 59 | + echo "Signing assets for ${{env.VERSION}}" |
| 60 | + . .venv/bin/activate |
| 61 | + pontos-release sign \ |
| 62 | + --signing-key ${{ env.GPG_FINGERPRINT }} \ |
| 63 | + --passphrase ${{ env.GPG_PASSPHRASE }} \ |
| 64 | + --release-version ${{ env.VERSION }} |
0 commit comments