Skip to content

Commit

Permalink
Merge pull request #4 from trendmicro/fix/workflow
Browse files Browse the repository at this point in the history
Fixed release workflow
  • Loading branch information
t0mz06 authored Jan 10, 2024
2 parents 8e32d7b + a28541e commit d46aacf
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: releases/${{ github.event.inputs.version }}
ssh-key: ${{ secrets.USER_SSH_KEY }}
fetch-depth: 0
- name: Set up Python 3.7
Expand All @@ -25,30 +26,31 @@ jobs:
python-version: "3.7"
- name: Set up Git
run: |
echo "${{ secrets.USER_GPG_KEY }}" | gpg --import
git config --add user.name "${{ secrets.USER_NAME }}"
git config --add user.email "${{ secrets.USER_MAIL }}"
git config --add user.signingkey "${{ secrets.USER_GPG_ID }}"
git config commit.gpgsign true
- name: Run build
run: |
pip install --upgrade hatch
hatch version ${{ env.VERSION }}
hatch --verbose build
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
- name: Merge release branch
run: |
git checkout ${{ env.BRANCH }}
git commit -am "Release ${{ env.VERSION }}: increment version"
git checkout main
git merge --no-ff ${{ env.BRANCH }}
git tag -a ${{ env.VERSION }} -m "Release ${{ env.VERSION }}"
git tag -a v${{ env.VERSION }} -m "Release ${{ env.VERSION }}"
git push --atomic origin main refs/tags/v${{ env.VERSION }}
# Try to merge back release branch
git checkout ${{ env.BRANCH }}
git merge --ff-only main
git push --atomic origin main ${{ env.BRANCH }} refs/tags/${{ env.VERSION }}
# Try to merge back release branch
git checkout develop
git merge --no-ff ${{ env.BRANCH }}
git branch -d ${{ env.BRANCH }}
git push origin develop :${{ env.BRANCH }}
git push origin develop :${{ env.BRANCH }}
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_TOKEN }}
verbose: true

0 comments on commit d46aacf

Please sign in to comment.