forked from dkaser/unraid-tailscale
-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (57 loc) · 2.29 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (57 loc) · 2.29 KB
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
59
60
61
62
63
64
name: Release
on:
release:
types:
- prereleased
- released
- published
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: dkaser/unraid-plugin-release-action@v1
id: release_action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
plg_branch: trunk
build_prereleases: true
ssh_key: ${{ secrets.DEPLOY_KEY }}
composer_dir: src/usr/local/php/unraid-tailscale-utils/
php_extensions: gmp
# Print out the commit SHA
- name: Print commit SHA
run: echo "Commit SHA ${{ steps.release_action.outputs.commit_long_sha }}"
# Update preview tag using git
- name: Update preview tag
run: |
cd ${{ github.workspace }}/main
git tag -f preview ${{ steps.release_action.outputs.commit_long_sha }}
git push origin preview --force
# Update main tag if not a prerelease
- name: Update main tag
if: github.event.release.prerelease == false
run: |
cd ${{ github.workspace }}/main
git tag -f main ${{ steps.release_action.outputs.commit_long_sha }}
git push origin main --force
- name: Notify Discord
uses: dkaser/discord-webhook-notify@tailscale
with:
webhookUrl: ${{ secrets.TAILSCALE_DISCORD_WEBHOOK }}
username: Tailscale Bot
avatarUrl: https://raw.githubusercontent.com/unraid/unraid-tailscale/trunk/logo.png
thumbnailUrl: https://raw.githubusercontent.com/unraid/unraid-tailscale/trunk/logo.png
severity: info
color: ${{ github.event.release.prerelease && '#ffff00' || '#00ff00' }}
title: New Update Available
description: |
## Tailscale Plugin Update : ${{ github.event.release.name }}
${{ github.event.release.body }}
fields: |
[
{"name": "Channel", "value": ${{ toJson(github.event.release.prerelease && 'Preview :test_tube:' || 'Release') }}, "inline": true},
{"name": "Tag", "value": ${{ toJson(github.event.release.tag_name) }}, "inline": true},
{"name": "Github Release", "value": ${{ toJson(format('[Link]({0})', github.event.release.html_url)) }}, "inline": true}
]