Skip to content

Commit

Permalink
Semantic release (#47)
Browse files Browse the repository at this point in the history
* Switch to semantic-release

* Add semantic-release configuration
  • Loading branch information
mcbanderson authored Dec 13, 2020
1 parent 932c0d1 commit 01464f8
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 59 deletions.
8 changes: 8 additions & 0 deletions .github/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": [
["@semantic-release/commit-analyzer"],
["@semantic-release/release-notes-generator"],
["@semantic-release/github"]
],
"preset": "eslint"
}
40 changes: 40 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish release to PyPI

on:
release:
types:
- published

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine pyaml
- name: Trigger docs update
run: |
curl -X POST https://api.github.com/repos/reflexivesecurity/reflex-docs-infrastructure/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token $GITHUB_TOKEN" \
--data '{"event_type": "deploy"}'
env:
GITHUB_TOKEN: ${{ secrets.CLOUDMITIGATOR_GITHUB_PAT }}
- name: Set version
run: |
echo "VERSION=$(gh release view | sed -n 2p | awk '{ print $2 }')" >> $GITHUB_ENV
echo "EGG=$(ls dist)" >> $GITHUB_ENV
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
export VERSION=${{ env.VERSION }}
python setup.py sdist bdist_wheel
twine upload dist/*
59 changes: 0 additions & 59 deletions .github/workflows/pythonpublish.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create new release

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: |
npm install @semantic-release/commit-analyzer \
@semantic-release/release-notes-generator \
@semantic-release/github \
conventional-changelog-eslint \
semantic-release
- name: Create release
run: |
npx semantic-release -e ./.github/.releaserc.json
env:
GITHUB_TOKEN: ${{ secrets.CLOUDMITIGATOR_GITHUB_PAT }}

0 comments on commit 01464f8

Please sign in to comment.