-
Notifications
You must be signed in to change notification settings - Fork 588
81 lines (64 loc) · 2.26 KB
/
release.yml
File metadata and controls
81 lines (64 loc) · 2.26 KB
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
74
75
76
77
78
79
80
81
# .github/workflows/release.yml
name: Release
on:
push:
tags:
- '**'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Checkout the current branch
run: |
echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
git fetch --unshallow --tags
git tag
if [[ $(git rev-parse --abbrev-ref HEAD) == "master" ]]; then
echo "reattaching HEAD on master"
git symbolic-ref --short HEAD || git checkout -b ${GITHUB_ENV}-test $GITHUB_ENV
fi
sudo apt update -q
yes | sudo ./scripts/bootstrap-dev-debian.sh
./scripts/bootstrap-dev-pip.sh system
export DISPLAY=:99.0
- name: Set env
if: startsWith(github.ref, 'refs/tags')
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_GUAKE=$(echo $GITHUB_REF_NAME)" >> $GITHUB_ENV
- name: Build
if: startsWith(github.ref, 'refs/tags')
run: |
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_GUAKE=$SETUPTOOLS_SCM_PRETEND_VERSION_FOR_GUAKE"
set -e
mkdir test-rtd
virtualenv test-rtd
. ./test-rtd/bin/activate
pip install -r requirements-dev.txt
rm -rf test-rtd
# for dev
make dev-actions
pipenv run pip install pycairo pygobject
# check
make build
# prepare for deployment
make generate-paths
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verify-metadata: false
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
verify-metadata: false
password: ${{ secrets.PYPI_API_TOKEN }}