forked from Project-MONAI/MONAI
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.43 KB
/
weekly-preview.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
name: weekly-preview
on:
schedule:
- cron: "0 2 * * 0" # 02:00 of every Sunday
jobs:
packaging:
if: github.repository == 'Project-MONAI/MONAI'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: dev
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install setuptools
run: |
python -m pip install --user --upgrade setuptools wheel
- name: Build distribution
run: |
export HEAD_COMMIT_ID=$(git rev-parse HEAD)
sed -i 's/name\ =\ monai$/name\ =\ monai-weekly/g' setup.cfg
echo "__commit_id__ = \"$HEAD_COMMIT_ID\"" >> monai/__init__.py
git diff setup.cfg monai/__init__.py
git config user.name "CI Builder"
git config user.email "[email protected]"
git add setup.cfg monai/__init__.py
git commit -m "Weekly build at $HEAD_COMMIT_ID"
export YEAR_WEEK=$(date +'%y%U')
echo "Year week for tag is ${YEAR_WEEK}"
if ! [[ $YEAR_WEEK =~ ^[0-9]{4}$ ]] ; then echo "Wrong 'year week' format. Should be 4 digits."; exit 1 ; fi
git tag "1.3.dev${YEAR_WEEK}"
git log -1
git tag --list
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}