40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
name: Make GitHub Release on Tag
|
|
on:
|
|
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: Download tarball
|
|
run: curl -LO https://github.com/netdisco/netdisco/archive/refs/tags/${{ steps.get_tag.outputs.TAGVALUE }}.tar.gz
|
|
- name: Rename tarball
|
|
run: mv ${{ steps.get_tag.outputs.TAGVALUE }}.tar.gz netdisco-mibs.tar.gz
|
|
- name: Get upload URL
|
|
run: echo UPLOAD_URL=${{ steps.create_release.outputs.upload_url }} | cut -d ' ' -f 1 >> $GITHUB_ENV
|
|
- name: Upload tarball
|
|
run: |
|
|
curl \
|
|
-f \
|
|
-sSL \
|
|
-XPOST \
|
|
-H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
|
|
-H 'Content-Type: application/gzip' \
|
|
--upload-file 'netdisco-mibs.tar.gz' \
|
|
'${{ env.UPLOAD_URL }}=netdisco-mibs.tar.gz'
|
|
- name: Setup tmate session
|
|
uses: mxschmitt/action-tmate@v3
|
|
if: always()
|
|
|