Files
deskflow/.github/workflows/create-release.yml
2024-07-16 19:38:33 +01:00

51 lines
1.3 KiB
YAML

name: Create release
on:
workflow_dispatch:
push:
branches:
- master
- release/**
jobs:
create-release:
if: ${{ vars.CREATE_RELEASE }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch all tags
fetch-depth: 0
- name: Read version file
run: echo "CURRENT_VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Override stage
if: ${{ !startsWith(github.ref, 'refs/heads/release') }}
run: echo "OVERRIDE_STAGE=snapshot" >> $GITHUB_ENV
- name: Get next version
id: next-version
uses: symless/actions/next-version@master
with:
current-version: ${{ env.CURRENT_VERSION }}
override-stage: ${{ env.OVERRIDE_STAGE }}
- name: Print next version
run: echo ${{ steps.next-version.outputs.next-version }}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
with:
tag_name: ${{ steps.next-version.outputs.next-version }}
release_name: ${{ steps.next-version.outputs.next-version }}
draft: false
prerelease: ${{ !startsWith(github.ref, 'refs/heads/release') }}