Skip to content

Commit

Permalink
Merge pull request greenbone#610 from greenbone/y0urself/workflows-main
Browse files Browse the repository at this point in the history
[CI][main] Update release workflows, add update header workflow
  • Loading branch information
y0urself authored Feb 22, 2022
2 parents 41b25c2 + 39eee6b commit 80745a6
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 43 deletions.
54 changes: 11 additions & 43 deletions .github/workflows/release-pontos-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,18 @@ on:

jobs:
release-patch:
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: Release patch with pontos
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Release with release action
uses: greenbone/actions/release-python@v1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install poetry and dependencies
uses: greenbone/actions/poetry@v1
- 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 }}
- run: echo "Current Branch is $GITHUB_BASE_REF"
- name: Prepare patch release with pontos
run: |
poetry run pontos-release prepare --patch
echo "VERSION=$(poetry run pontos-version show)" >> $GITHUB_ENV
- name: Release with pontos
run: |
poetry run pontos-release release
- 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}}"
poetry run pontos-release sign \
--signing-key ${{ env.GPG_FINGERPRINT }} \
--passphrase ${{ env.GPG_PASSPHRASE }} \
--release-version ${{ env.VERSION }}
version: 3.8
conventional-commits: true
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 }}
strategy: calendar
25 changes: 25 additions & 0 deletions .github/workflows/release-pontos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release Python package with pontos

on:
pull_request:
types: [closed]

jobs:
build-and-release:
name: Build and release with pontos
# If the label 'make release' is set. If PR is closed because of an merge
if: contains( github.event.pull_request.labels.*.name, 'make release') && github.event.pull_request.merged == true
runs-on: 'ubuntu-latest'
steps:
- name: Release with release action
uses: greenbone/actions/release-python@v1
with:
version: 3.8
conventional-commits: true
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 }}
strategy: calendar
20 changes: 20 additions & 0 deletions .github/workflows/update-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Update Headers

on:
workflow_dispatch:
schedule:
- cron: '0 0 1 1 *' # At 00:00 on day-of-month 1 in January.

jobs:
update-header:
name: Update headers
runs-on: 'ubuntu-latest'
steps:
- name: Run update header
uses: greenbone/actions/update-header@v1
with:
github-user: ${{ secrets.GREENBONE_BOT }}
github-user-mail: ${{ secrets.GREENBONE_BOT_MAIL }}
github-user-token: ${{ secrets.GREENBONE_BOT_TOKEN }}
directories: ospd ospd_openvas tests
target: main
8 changes: 8 additions & 0 deletions changelog.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commit_types = [
{ message = "^add", group = "Added"},
{ message = "^remove", group = "Removed"},
{ message = "^change", group = "Changed"},
{ message = "^fix", group = "Bug Fixes"},
]

changelog_dir = "changelog"

0 comments on commit 80745a6

Please sign in to comment.