forked from netdisco/netdisco-mibs
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 2.11 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: GitHub Release on Tag
on:
push:
tags:
- '4.[0-9][0-9][0-9]'
jobs:
release_netdisco_mibs:
if: github.repository == 'railsboot/netdisco-mibs'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the Tag
run: echo "GH_REF_SHORT=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
- name: Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: netdisco-mibs-${{ env.GH_REF_SHORT }}
continue-on-error: true
- name: Download tarball
run: curl -LO https://github.com/railsboot/netdisco-mibs/archive/refs/tags/${{ env.GH_REF_SHORT }}.tar.gz
- name: Rename tarball
run: mv ${{ env.GH_REF_SHORT }}.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
id: upload_tarball_after_release
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'
continue-on-error: true
- name: IRC upload failure notification
if: (steps.create_release.outcome == 'failure') || (steps.upload_tarball_after_release.outcome == 'failure')
uses: Gottox/irc-message-action@v2
with:
channel: '#railsboot'
nickname: github-actions
message: |-
🤖 Failed to release Netdisco MIBS ${{ env.GH_REF_SHORT }} 😭
👀 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: IRC upload success notification
if: steps.upload_tarball_after_release.outcome == 'success'
uses: Gottox/irc-message-action@v2
with:
channel: '#railsboot'
nickname: github-actions
message: |-
🤖 Released Netdisco MIBS ${{ env.GH_REF_SHORT }} 🎉