|
| 1 | +# Automatically pull down the required versions of windows plugins |
| 2 | +# and bundle them up for releases. This makes staging on non-internet |
| 3 | +# connected systems easier. |
| 4 | +name: "DEPLOY" |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + tags: |
| 9 | + - "v*.*.*" |
| 10 | + |
| 11 | +jobs: |
| 12 | + release: |
| 13 | + name: Release |
| 14 | + runs-on: ubuntu-latest |
| 15 | + if: startsWith(github.ref, 'refs/tags/') |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: Setup Python 3.9 |
| 21 | + uses: actions/setup-python@v2 |
| 22 | + with: |
| 23 | + python-version: "3.9" |
| 24 | + |
| 25 | + - name: Installing Python Poetry |
| 26 | + run: pip install poetry |
| 27 | + |
| 28 | + - name: Install and Build pwncat-cs Package |
| 29 | + run: | |
| 30 | + poetry install |
| 31 | + poetry build |
| 32 | +
|
| 33 | + - name: Publish Package to TestPyPi |
| 34 | + run: | |
| 35 | + # Test that package publishing is going to work with the testpypi |
| 36 | + # instance first before trying to package plugins. |
| 37 | + poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }} |
| 38 | + poetry config repositories.testpypi https://test.pypi.org/legacy/ |
| 39 | + poetry publish --repository testpypi |
| 40 | +
|
| 41 | + - name: Publish Package to PyPi |
| 42 | + run: | |
| 43 | + # Everything looks good, publish to pypi |
| 44 | + poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} |
| 45 | + poetry publish |
| 46 | +
|
| 47 | + - name: Extract Release Body |
| 48 | + run: | |
| 49 | + # Grab tag name without the `v` |
| 50 | + version=$(git describe --tags --abbrev=0 | sed 's/v//') |
| 51 | + # build a changelog with just logs from this release |
| 52 | + echo "## Changelog" >> this_version_changelog.md |
| 53 | + cat CHANGELOG.md | sed -n '/^## \['"$version"'\]/,/^## /p' | head -n -1 | tail -n +2 >> this_version_changelog.md |
| 54 | + echo "[Full Changelog](https://github.com/brootware/PyRedactKit/blob/v$version/CHANGELOG.md)" >> this_version_changelog.md |
0 commit comments