summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorMilas Bowman <milas.bowman@docker.com>2022-07-30 12:14:27 -0400
committerGitHub <noreply@github.com>2022-07-30 12:14:27 -0400
commitcd2c35a9b699522b282cc4f024efa5699df24896 (patch)
tree18717584169b7cbbd1196be5fe327dd36136aad7 /.github/workflows
parent828d06f5f5e2c8ecd9a8d53c1ef40f37d19a62f5 (diff)
downloaddocker-py-cd2c35a9b699522b282cc4f024efa5699df24896.tar.gz
ci: add workflow for releases (#3018)
GitHub Actions workflow to create a release: will upload to PyPI and create a GitHub release with the `sdist` and `bdist_wheel` as well. The version code is switched to `setuptools_scm` to work well with this flow (e.g. avoid needing to write a script that does a `sed` on the version file and commits as part of release). Signed-off-by: Milas Bowman <milas.bowman@docker.com>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yml3
-rw-r--r--.github/workflows/release.yml44
2 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 296bf0d..d163412 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,6 +2,9 @@ name: Python package
on: [push, pull_request]
+env:
+ DOCKER_BUILDKIT: '1'
+
jobs:
flake8:
runs-on: ubuntu-latest
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..50695b1
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,44 @@
+name: Release
+
+on:
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: "Release Tag WITHOUT `v` Prefix (e.g. 6.0.0)"
+ required: true
+ dry-run:
+ description: 'Dry run'
+ required: false
+ type: boolean
+ default: true
+
+jobs:
+ publish:
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+
+ - run: python setup.py sdist bdist_wheel
+ env:
+ SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DOCKER: ${{ inputs.tag }}
+
+ - name: Publish to PyPI
+ uses: pypa/gh-action-pypi-publish@release/v1
+ if: ! inputs.dry-run
+ with:
+ password: ${{ secrets.PYPI_API_TOKEN }}
+
+ - name: Create GitHub release
+ uses: ncipollo/release-action@v1
+ if: ! inputs.dry-run
+ with:
+ artifacts: "dist/*"
+ generateReleaseNotes: true
+ draft: true
+ commit: ${{ github.sha }}
+ token: ${{ secrets.GITHUB_TOKEN }}
+ tag: ${{ inputs.tag }}