Skip to content

Commit

Permalink
add github action to do release and upload netdisco-mibs.tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
ollyg committed Aug 17, 2021
1 parent fdcfd37 commit baa503b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: GitHub Release on Tag
on:
push:
tags:
- '2.[0-9][0-9][0-9][0-9][0-9][0-9]'
jobs:
release_netdisco_mibs:
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-mibs-${{ steps.get_tag.outputs.TAGVALUE }}
- name: Download tarball
run: curl -LO https://github.com/netdisco/netdisco-mibs/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'

0 comments on commit baa503b

Please sign in to comment.