diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..adb51d5 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,37 @@ +name: CI/CD +on: + push: + tags: + - '*' +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + version=$(git describe --tags --always) + sed -i 's/^__version__ = .*$/__version__ = "'"${version}"'"/' \ + src/wheezy/core/__init__.py + python setup.py sdist + twine upload dist/* + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }}