Skip to content

Commit

Permalink
[noaction] trying a different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
larsvilhuber committed Dec 8, 2020
1 parent 886cd08 commit 0acefbf
Showing 1 changed file with 36 additions and 18 deletions.
54 changes: 36 additions & 18 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
on:
push:
branches:
- releases
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
name:
# Friendly description to be shown in the UI instead of 'name'
description: 'Your name'
# Default value if no value is explicitly provided
default: 'Github'
# Input has to be provided for the workflow to run
required: true
version:
# Friendly description to be shown in the UI instead of 'name'
description: 'Version to create (must start with a number, e.g. 0.1-rc1 or 0.2 - the v will be prepended!)'
# Default value if no value is explicitly provided
default: '0.0'
# Input has to be provided for the workflow to run
required: true
message:
# Friendly description to be shown in the UI instead of 'name'
description: 'Message for release'
# Default value if no value is explicitly provided
default: 'For the most recent version and additional information, see https://social-science-data-editors.github.io/template_README/.'
# Input has to be provided for the workflow to run
required: true
prerelease:
# Friendly description to be shown in the UI instead of 'name'
description: 'Is this a pre-release? (true/false)'
# Default value if no value is explicitly provided
default: 'true'
# Input has to be provided for the workflow to run
required: true
name: Create Release

jobs:
Expand All @@ -17,21 +41,15 @@ jobs:
uses: actions/checkout@v2
with:
ref: releases
- name: Prepare tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF##refs/tags/}"
echo "::set-output name=tag_name::${TAG_NAME}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.prepare_tag.outputs.tag_name }}
release_name: Template README in Social Sciences ${{ steps.prepare_tag.outputs.tag_name }}
tag_name: v${{ github.event.inputs.version }}
release_name: Template README in Social Sciences v${{ github.event.inputs.version }}
body: |
For the most recent version and additional information, see https://social-science-data-editors.github.io/template_README/.
${{ github.event.inputs.message }}
draft: false
prerelease: true
prerelease: ${{ github.event.inputs.prerelease }}

0 comments on commit 0acefbf

Please sign in to comment.