forked from UKRIN-MAPS/ukat
-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (65 loc) · 2.7 KB
/
new_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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This is a basic workflow to help you get started with Actions
name: Generate new release, build and publish to PyPI
# Controls when the action will run.
on:
push:
tags:
- 'v*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set variables
id: set_vars
run: |
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "::set-output name=prerelease::false"
fi
if [[ "${{github.base_ref}}" != "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "::set-output name=prerelease::true"
fi
- name: Release
uses: docker://antonyurchenko/git-release:v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "false"
PRE_RELEASE: "false"
CHANGELOG_FILE: "CHANGELOG.md"
ALLOW_EMPTY_CHANGELOG: "false"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine wheel
- name: Build binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# - name: Tweet
# uses: m1ner79/Github-Twittction@master
# with:
# twitter_status: "Version ${{github.event.release.tag_name}} of ${{github.event.repository.full_name}} has been
# released. Take a look here ${{github.event.release.html_url}}."
# twitter_consumer_key: ${{ secrets.TWITTER_API_KEY }}
# twitter_consumer_secret: ${{ secrets.TWITTER_API_SECRET_KEY }}
# twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN }}
# twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}