Skip to content

Commit

Permalink
Add release action (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHjelmare committed Feb 21, 2021
1 parent 9dc7f16 commit a963721
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Draft release

on:
push:
branches:
- master
workflow_dispatch:

jobs:
update-release-draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v5.13.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
branches:
- main
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2.3.4
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v2.2.1
with:
python-version: "3.8"

- name: Upgrade pip
run: |
python -m pip install pip
pip --version
- name: Install dependencies
run: |
pip install -r requirements_pypi.txt
- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/action-detect-and-tag-new-version@v2.0.1
with:
version-command: |
bash -o pipefail -c "cat imjoy_elfinder/VERSION | jq '.version'"
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: "${{ secrets.PYPI_TOKEN }}"

- name: Publish the release notes
uses: release-drafter/release-drafter@v5.13.0
with:
publish: "${{ steps.check-version.outputs.tag != '' }}"
tag: "${{ steps.check-version.outputs.tag }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
3 changes: 3 additions & 0 deletions requirements_pypi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setuptools==53.0.0
twine==3.3.0
wheel==0.36.2

0 comments on commit a963721

Please sign in to comment.