Skip to content

updated

updated #6

name: Create auto release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
auto_release:
name: Auto release
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Check if release already exists
run: |
existing_release=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }} 2>&1)
if [[ $existing_release == *"Not Found"* ]]; then
echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
else
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
fi
- name: Create Release
id: create_release
if: ${{ env.RELEASE_EXISTS == 'false' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Version ${{ github.ref_name }}
body: Version ${{ github.ref_name }}
draft: false
prerelease: false