forked from facebookresearch/vrs
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.61 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
name: VRS Release
on: [push]
jobs:
get-current-version:
if: github.repository == 'facebookresearch/vrs'
runs-on: ubuntu-latest
steps:
- name: checkout-repo-content
uses: actions/checkout@v2
- name: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: get current version and tag
id: get-current-version-and-tag
run: |
output=$(python3 release_utils.py --get-current-version)
echo $output
current_version=$(echo $output | awk '{print $1}')
current_tag=$(echo $output | awk '{print $2}')
echo "current version is $current_version"
echo "current tag is $current_tag"
echo ::set-output name=version::$current_version
echo ::set-output name=tag::$current_tag
outputs:
current_version: ${{ steps.get-current-version-and-tag.outputs.version }}
current_tag: ${{ steps.get-current-version-and-tag.outputs.tag }}
create-release-if-not-exist:
if: github.repository == 'facebookresearch/vrs'
runs-on: ubuntu-latest
needs:
- get-current-version
steps:
- id: get-latest-tag
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
- name: checkout-repo-content
uses: actions/checkout@v2
- name: Create release
if: needs.get-current-version.outputs.current_tag != steps.get-latest-tag.outputs.release
uses: ncipollo/release-action@v1
with:
tag: '${{ needs.get-current-version.outputs.current_tag }}'