Files
netdisco/.github/workflows/release.yml
2021-08-17 16:47:40 +01:00

53 lines
1.8 KiB
YAML

name: Make GitHub Release on Tag
on:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
push:
tags:
- '2.[0-9][0-9][0-9][0-9][0-9][0-9]'
jobs:
release_netdisco:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the Tag
id: get_tag
run: echo ::set-output name=TAGVALUE::${GITHUB_REF#refs/tags/}
- name: Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: Netdisco ${{ steps.get_tag.outputs.TAGVALUE }}
- name: get upload url 2
run: echo ${{ steps.create_release.outputs.upload_url }}
- name: get upload url
run: echo ${{ steps.create_release.outputs.upload_url }} > uploadurl.txt
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: always() && github.event.inputs.debug_enabled && (github.event_name == 'workflow_dispatch')
with:
sudo: true
#jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@master
# - name: Get the Tag
# id: get_tag
# run: echo ::set-output name=TAGVALUE::${GITHUB_REF#refs/tags/}
# - name: Netdisco Release
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# run: |
# curl -sL -X POST -H "Content-Type: application/json" \
# -u "$GITHUB_TOKEN" \
# --data "{\"tag_name\": \"${{ steps.get_tag.outputs.TAGVALUE }}\", \
# \"target_commitish\": \"master\", \
# \"name\": \"Netdisco ${{ steps.get_tag.outputs.TAGVALUE }}\"}" \
# https://api.github.com/repos/netdisco/netdisco/releases