Skip to content

Commit 976d552

Browse files
authored
Merge pull request #88 from Nautilus-Cyberneering/issue-86-fix-publishing-depedency-error
Fix Git and GPG credentials being injected in the publishing workflows
2 parents b6e792e + 86ac5d1 commit 976d552

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

.github/workflows/publish-docker-image.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
tags:
66
- "*.*.*"
7-
workflow_dispatch:
87

98
jobs:
109
build:
@@ -17,6 +16,16 @@ jobs:
1716
- name: Checkout
1817
uses: actions/checkout@v2
1918

19+
- name: Import GPG key used for testing
20+
id: import-gpg
21+
uses: crazy-max/ghaction-import-gpg@v4
22+
with:
23+
gpg_private_key: ${{ secrets.TEST_GPG_PRIVATE_KEY }}
24+
passphrase: ${{ secrets.TEST_PASSPHRASE }}
25+
git_user_signingkey: true
26+
git_commit_gpgsign: true
27+
git_config_global: true
28+
2029
- name: Setup Python
2130
uses: actions/setup-python@v2.3.1
2231
with:
@@ -71,3 +80,11 @@ jobs:
7180
images: |
7281
nautiluscyberneering/librarian
7382
ghcr.io/${{ github.repository }}
83+
84+
- name: Build and push Docker images
85+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
86+
with:
87+
context: .
88+
push: true
89+
tags: ${{ steps.meta.outputs.tags }}
90+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/publish-github-release.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
tags:
66
- "*.*.*"
7-
workflow_dispatch:
87

98
jobs:
109
build:
@@ -16,6 +15,16 @@ jobs:
1615
- name: Checkout
1716
uses: actions/checkout@v2
1817

18+
- name: Import GPG key used for testing
19+
id: import-gpg
20+
uses: crazy-max/ghaction-import-gpg@v4
21+
with:
22+
gpg_private_key: ${{ secrets.TEST_GPG_PRIVATE_KEY }}
23+
passphrase: ${{ secrets.TEST_PASSPHRASE }}
24+
git_user_signingkey: true
25+
git_commit_gpgsign: true
26+
git_config_global: true
27+
1928
- name: Setup Python
2029
uses: actions/setup-python@v2.3.1
2130
with:
@@ -58,3 +67,11 @@ jobs:
5867
run: |
5968
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
6069
|| echo ::set-output name=prerelease::true
70+
71+
- name: Create Release
72+
uses: ncipollo/release-action@v1
73+
with:
74+
artifacts: "dist/*"
75+
token: ${{ secrets.GITHUB_TOKEN }}
76+
draft: false
77+
prerelease: steps.check-version.outputs.prerelease == 'true'

.github/workflows/publish-pypi-package.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
tags:
66
- "*.*.*"
7-
workflow_dispatch:
87

98
jobs:
109
build:
@@ -14,6 +13,16 @@ jobs:
1413
- name: Checkout
1514
uses: actions/checkout@v2
1615

16+
- name: Import GPG key used for testing
17+
id: import-gpg
18+
uses: crazy-max/ghaction-import-gpg@v4
19+
with:
20+
gpg_private_key: ${{ secrets.TEST_GPG_PRIVATE_KEY }}
21+
passphrase: ${{ secrets.TEST_PASSPHRASE }}
22+
git_user_signingkey: true
23+
git_commit_gpgsign: true
24+
git_config_global: true
25+
1726
- name: Setup Python
1827
uses: actions/setup-python@v2.3.1
1928
with:
@@ -50,3 +59,8 @@ jobs:
5059

5160
- name: Build Python package
5261
run: poetry build
62+
63+
- name: Publish to PyPI
64+
env:
65+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
66+
run: poetry publish

0 commit comments

Comments
 (0)