Skip to content

Commit

Permalink
Merge pull request #88 from Nautilus-Cyberneering/issue-86-fix-publis…
Browse files Browse the repository at this point in the history
…hing-depedency-error

Fix Git and GPG credentials being injected in the publishing workflows
  • Loading branch information
josecelano authored Feb 17, 2022
2 parents b6e792e + 86ac5d1 commit 976d552
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
tags:
- "*.*.*"
workflow_dispatch:

jobs:
build:
Expand All @@ -17,6 +16,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Import GPG key used for testing
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.TEST_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.TEST_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true

- name: Setup Python
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -71,3 +80,11 @@ jobs:
images: |
nautiluscyberneering/librarian
ghcr.io/${{ github.repository }}
- name: Build and push Docker images
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
19 changes: 18 additions & 1 deletion .github/workflows/publish-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
tags:
- "*.*.*"
workflow_dispatch:

jobs:
build:
Expand All @@ -16,6 +15,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Import GPG key used for testing
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.TEST_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.TEST_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true

- name: Setup Python
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -58,3 +67,11 @@ jobs:
run: |
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
|| echo ::set-output name=prerelease::true
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: steps.check-version.outputs.prerelease == 'true'
16 changes: 15 additions & 1 deletion .github/workflows/publish-pypi-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
tags:
- "*.*.*"
workflow_dispatch:

jobs:
build:
Expand All @@ -14,6 +13,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Import GPG key used for testing
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.TEST_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.TEST_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true

- name: Setup Python
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -50,3 +59,8 @@ jobs:

- name: Build Python package
run: poetry build

- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: poetry publish

0 comments on commit 976d552

Please sign in to comment.