Merge pull request #500 from Idein/dependabot/pip/pytorch-ignite-0.5.1 #456
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |