Skip to content

Commit 3c957a4

Browse files
Merge pull request #8 from nextmv-io/feature/fix-signing
Feature/fix signing
2 parents 04e031d + 024f50e commit 3c957a4

File tree

1 file changed

+34
-39
lines changed

1 file changed

+34
-39
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: "The version to release"
88
required: true
99
IS_PRE_RELEASE:
10-
description: "Whether this is a pre-release"
10+
description: "It IS a pre-release"
1111
required: true
1212
default: false
1313
type: boolean
@@ -21,13 +21,9 @@ jobs:
2121
env:
2222
VERSION: ${{ inputs.VERSION }}
2323
GH_TOKEN: ${{ github.token }}
24+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
2425
steps:
25-
- name: git clone develop
26-
uses: actions/checkout@v4
27-
with:
28-
ref: develop
29-
30-
- name: Set up Python
26+
- name: set up Python
3127
uses: actions/setup-python@v4
3228
with:
3329
python-version: "3.12"
@@ -37,53 +33,30 @@ jobs:
3733
pip install --upgrade pip
3834
pip install build twine hatch
3935
40-
- name: upgrade version with hatch
41-
run: hatch version ${{ env.VERSION }}
42-
43-
- name: build binary wheel and source tarball
44-
env:
45-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
46-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
47-
run: |
48-
python -m build
49-
50-
- name: publish to TestPyPI
51-
env:
52-
TWINE_USERNAME: ${{ secrets.TESTPYPI_USERNAME }}
53-
TWINE_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }}
54-
run: twine upload --repository testpypi dist/*
55-
56-
- name: publish to PyPI
57-
env:
58-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
59-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
60-
run: twine upload dist/*
61-
6236
- name: configure git with the bot credentials
63-
env:
64-
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
6537
run: |
6638
mkdir -p ~/.ssh
6739
ssh-keyscan github.com >> ~/.ssh/known_hosts
6840
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
6941
ssh-add - <<< "${{ secrets.NEXTMVBOT_SSH_KEY }}"
7042
71-
echo "${{ secrets.NEXTMVBOT_SIGNING_KEY }}" > ~/.ssh/signing.key
72-
chmod 600 ~/.ssh/signing.key
73-
7443
git config --global user.name "nextmv-bot"
7544
git config --global user.email "tech+gh-nextmv-bot@nextmv.io"
76-
git config --global url."git@github.com:".insteadOf "https://github.com/"
77-
git config --global gpg.format ssh
78-
git config --global user.signingkey ~/.ssh/signing.key
45+
46+
git clone git@github.com:nextmv-io/nextmv-py.git
47+
48+
- name: upgrade version with hatch
49+
run: hatch version ${{ env.VERSION }}
50+
working-directory: ./nextmv-py
7951

8052
- name: commit new version
8153
run: |
8254
git add nextmv/__about__.py
83-
git commit -S -m "Bump version to $VERSION"
55+
git commit -m "Bump version to $VERSION"
8456
git push
8557
git tag $VERSION
8658
git push origin $VERSION
59+
working-directory: ./nextmv-py
8760

8861
- name: create release
8962
run: |
@@ -92,7 +65,29 @@ jobs:
9265
PRERELEASE_FLAG="--prerelease"
9366
fi
9467
95-
gh release create -R nextmv-io/nextmv-py $VERSION \
68+
gh release create $VERSION \
9669
--verify-tag \
9770
--generate-notes \
9871
--title $VERSION $PRERELEASE_FLAG
72+
working-directory: ./nextmv-py
73+
74+
- name: build binary wheel and source tarball
75+
env:
76+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
77+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
78+
run: python -m build
79+
working-directory: ./nextmv-py
80+
81+
- name: publish to TestPyPI
82+
env:
83+
TWINE_USERNAME: ${{ secrets.TESTPYPI_USERNAME }}
84+
TWINE_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }}
85+
run: twine upload --repository testpypi dist/*
86+
working-directory: ./nextmv-py
87+
88+
- name: publish to PyPI
89+
env:
90+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
91+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
92+
run: twine upload dist/*
93+
working-directory: ./nextmv-py

0 commit comments

Comments
 (0)