8000 Change: Use a single workflow file for releases · greenbone/autohooks@0a297ca · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 0a297ca

Browse files
committed
Change: Use a single workflow file for releases
Merge manual and automatic releases (via PR label) into a single CI workflow.
1 parent 6b84090 commit 0a297ca

File tree

2 files changed

+13
-33
lines changed

2 files changed

+13
-33
lines changed

.github/workflows/release-pontos-manually.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/release-pontos.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,25 @@ name: Release Python package with pontos
33
on:
44
pull_request:
55
types: [closed]
6+
workflow_dispatch:
67

78
jobs:
89
build-and-release:
9-
name: Build and release with pontos
10-
# If the label 'make release' is set. If PR is closed because of an merge
11-
if: contains( github.event.pull_request.labels.*.name, 'make release') && github.event.pull_request.merged == true
10+
name: Create a new release with pontos
11+
# If the event is a workflow_dispatch or the label 'make release' is set and PR is closed because of a merge
12+
if: (github.event_name == 'workflow_dispatch') || (contains( github.event.pull_request.labels.*.name, 'make release') && github.event.pull_request.merged == true)
1213
runs-on: "ubuntu-latest"
1314
steps:
15+
- name: Setting the Reference
16+
run: |
17+
if [[ "${{ github.event_name }}" = "workflow_dispatch" ]]; then
18+
echo "RELEASE_REF=${{ github.ref_name }}" >> $GITHUB_ENV
19+
else
20+
echo "RELEASE_REF=${{ github.base_ref }}" >> $GITHUB_ENV
21+
fi
1422
- name: Release with release action
15-
uses: greenbone/actions/release-python@v2
23+
uses: greenbone/actions/release@v2
1624
with:
17-
version: "3.10"
1825
conventional-commits: true
1926
github-user: ${{ secrets.GREENBONE_BOT }}
2027
github-user-mail: ${{ secrets.GREENBONE_BOT_MAIL }}
@@ -23,3 +30,4 @@ jobs:
2330
gpg-fingerprint: ${{ secrets.GPG_FINGERPRINT }}
2431
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
2532
strategy: calendar
33+
ref: ${{ env.RELEASE_REF }}

0 commit comments

Comments
 (0)
0