-
Notifications
You must be signed in to change notification settings - Fork 896
161 lines (134 loc) · 4.65 KB
/
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: darts release workflow
on:
workflow_dispatch:
inputs:
bump_type:
description: "Bump type (#major, #minor, #patch)"
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: "1. Clone repository"
uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_WORKFLOW_TOKEN_NEW_FINE_GRAINED }}
fetch-depth: '1'
- name: "2. Set up Python 3.10"
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: "Setup Pip"
run: |
python -m pip install --upgrade pip
- name: "Install release dependencies"
run: |
pip install -q -r requirements/release.txt
- name: "Determine next version"
uses: hrzn/github-tag-action@master
id: bump_dry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: true
BUMP_TYPE: ${{ github.event.inputs.bump_type}}
- name: "Bump version"
run: |
bump2version --new-version ${{ steps.bump_dry.outputs.new_tag }} patch
- name: "Commit new version"
uses: stefanzweifel/[email protected]
with:
commit_message: Release ${{ steps.bump_dry.outputs.new_tag }}
branch: master
push_options: --force
commit_user_name: Unit8 Bot
commit_user_email: [email protected]
- name: "Publish new tag"
uses: hrzn/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: ${{steps.bump_dry.outputs.new_tag}}
- name: "10. Create new release"
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bump_dry.outputs.new_tag }}
release_name: Darts ${{steps.bump_dry.outputs.part}} ${{ steps.bump_dry.outputs.new_tag }}
draft: false
body_path: .github/RELEASE_TEMPLATE/release_body.md
deploy-docker:
needs: [release]
runs-on: ubuntu-latest
steps:
- name: "1. Clone repository"
uses: actions/checkout@v4
- name: "2. Determine current version"
uses: hrzn/github-tag-action@master
id: bump_dry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: true
BUMP_TYPE: ${{ github.event.inputs.bump_type}}
- name: "Set up QEMU"
uses: docker/setup-qemu-action@v3
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v3
- name: "Login to Docker Hub"
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: "Build and push"
uses: docker/build-push-action@v6
with:
push: true
tags: unit8/darts:${{ steps.bump_dry.outputs.tag }}, unit8/darts:latest
deploy-docs:
runs-on: ubuntu-latest
needs: [release]
steps:
- name: "Clone repository"
uses: actions/checkout@v4
- name: "Set up Python 3.10"
uses: actions/setup-python@v5
with:
python-version: '3.10'
# use `uv` to retrieve the latest dependency versions
- name: "Compile Dependency Versions"
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip compile requirements/dev-all.txt > requirements-latest.txt
# only restore cache but do not upload
- name: "Restore cached python environment"
uses: actions/cache/restore@v4
id: pythonenv-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
- name: "Install pandoc"
run: |
sudo apt-get install -y pandoc
- name: "Setup Pip"
run: |
python -m pip install --upgrade pip
- name: "Install Dependencies"
run: |
# install latest dependencies (potentially updating cached dependencies)
pip install -U -r requirements/dev-all.txt
- name: "Install libomp (for LightGBM)"
run: |
./.github/scripts/libomp-${{ runner.os }}.sh
- name: "Install Locally"
run: |
pip install .
- name: "Build docs"
run: |
make --directory ./docs build-all-docs
- name: "Publish documentation to gh-pages"
uses: s0/[email protected]
env:
REPO: self
BRANCH: gh-pages
FOLDER: docs/build/html
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}