generated from DCMLab/annotation_workflow_template
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (64 loc) · 2.55 KB
/
version_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
on:
pull_request:
types:
- closed
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout corpus repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.MS3_BOT_TOKEN }}
ref: "${{ github.event.pull_request.base.ref }}"
submodules: recursive
- name: "Get latest tag version"
id: tag
continue-on-error: true
run: |
res=$(git tag -l --sort=-v:refname | grep --invert-match '\^' | head -n 1)
echo "tag_version=${res}" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.MS3_BOT_TOKEN }}
- name: "Generate a new tag version"
id: generate_tag
run: |
major_in_PR="${{ contains(github.event.pull_request.labels.*.name, 'major_version')}}"
python .github/workflows/helper.py --tag "${{ steps.tag.outputs.tag_version }}" --update_major_ver "$major_in_PR"
- name: Setup Github credentials & push zenodo, citation and README changes
continue-on-error: true
run: |
git config --global user.name "ms3-bot"
git config --global user.email [email protected]
if [[ -f .zenodo.json ]]; then
git add .zenodo.json
fi
if [[ -f CITATION.cff ]]; then
git add CITATION.cff
fi
if [[ -f README.md ]]; then
git add README.md
fi
git commit -m 'chore: files updated with tag: ${{ steps.generate_tag.outputs.new_tag }}'
git push
- name: "Create tag"
run: |
git tag -a "${{ steps.generate_tag.outputs.new_tag }}" -m "chore: files updated with tag: ${{ steps.generate_tag.outputs.new_tag }}"
git push origin "${{ steps.generate_tag.outputs.new_tag }}"
- name: "Get ms3 package & apply transform"
continue-on-error: true
run: |
pip install --upgrade pip
pip install ms3
ms3 transform -M -N -X -F -C -D
- uses: ncipollo/release-action@v1
with:
artifacts: "${{ github.event.repository.name }}.zip,\
${{ github.event.repository.name }}.datapackage.json,\
${{ github.event.repository.name }}.datapackage.errors"
body: "${{ github.event.pull_request.body }}"
name: "${{ github.event.pull_request.title }}"
tag: "${{ steps.generate_tag.outputs.new_tag }}"
makeLatest: "latest"