-
Notifications
You must be signed in to change notification settings - Fork 29
50 lines (50 loc) · 1.84 KB
/
create-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version tag, e.g. 0.0.1'
required: true
jobs:
release:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
environment-file: environment.yml
activate-environment: blp-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- name: Environment setup
run: |
gem install github_changelog_generator
git config --global user.email "[email protected]"
git config --global user.name "github-actions[bot]"
- name: Version bump and tag
run: |
echo "Creating release for ${{ github.event.inputs.version }}"
echo "__version__ = \"${{ github.event.inputs.version }}\"" > src/blp/__init__.py
git add src/blp/__init__.py
git commit -m "RLS: Update version for upcoming release ${{ github.event.inputs.version }}"
git tag -a "v${{ github.event.inputs.version }}" -m "Version ${{ github.event.inputs.version }}"
git push && git push --tags
- name: Build and commit CHANGELOG
run: |
github_changelog_generator -u matthewgilbert -p blp --token ${{ secrets.GITHUB_TOKEN }}
git add CHANGELOG.md
git commit -m "RLS: Create CHANGELOG for release ${{ github.event.inputs.version }}"
git push
- name: Build package
run: python -m build --sdist --wheel --outdir dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true