-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (31 loc) · 1.03 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
name: release
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Create Version
id: create_version
run: |
TORCH_V=v$(grep '^torch==' requirements.txt | cut -f 3 -d '=')
VERSION=${TORCH_V}-$(date +'%Y.%m.%d')
API_PATH='repos/Idein/docker-pytorch/releases'
NUM_SUFFIX=$(gh api $API_PATH 2>/dev/null | jq -r '.[].tag_name' | grep "${VERSION}" | wc | awk '{print $1}')
echo ::set-output name=version::${VERSION}-${NUM_SUFFIX}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_version.outputs.version }}
release_name: Release ${{ steps.create_version.outputs.version }}
body: "Automated release"
draft: false
prerelease: false