-
Notifications
You must be signed in to change notification settings - Fork 383
108 lines (93 loc) · 4.08 KB
/
beta-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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Node-CI Beta
on:
push:
branches: [beta-*.*.*, beta]
workflow_dispatch:
jobs:
publish:
if: ${{ github.repository == 'homebridge/homebridge-config-ui-x' }}
uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
with:
tag: 'beta'
dynamically_adjust_version: true
npm_version_command: 'pre'
pre_id: 'beta'
install_cmd: npm ci && cd ui && npm ci
secrets:
npm_auth_token: ${{ secrets.npm_token }}
pre-release-beta:
needs: [publish]
name: "Create New Github Beta Pre Release"
if: ${{ github.repository == 'homebridge/homebridge-config-ui-x' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create nightly release
id: create_release
uses: viperproject/create-nightly-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.publish.outputs.NPM_VERSION }}
release_name: v${{ needs.publish.outputs.NPM_VERSION }}
body: |
v${{ needs.publish.outputs.NPM_VERSION }}
[How To Test Upcoming Changes](https://github.com/homebridge/homebridge-config-ui-x/wiki/How-To-Test-Upcoming-Changes)
keep_num: 5
keep_tags: false
attach-artifact:
name: Attach Artifact
needs: [publish, pre-release-beta]
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install package v${{ needs.publish.outputs.NPM_VERSION }}
run: |
export npm_config_prefix=$(pwd)/package
npm install -g homebridge-config-ui-x@${{ needs.publish.outputs.NPM_VERSION }}
- name: Remove invalid node-pty node-gyp run v${{ needs.publish.outputs.NPM_VERSION }}
run: |
rm -rf $(pwd)/package/lib/node_modules/homebridge-config-ui-x/node_modules/@homebridge/node-pty-prebuilt-multiarch/build
- name: Create Bundle v${{ needs.publish.outputs.NPM_VERSION }}
run: |
tar -C $(pwd)/package --owner=0 --group=0 --format=posix -czvf homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz .
shasum -a 256 homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz > SHASUMS256.txt
- name: Check Bundle v${{ needs.publish.outputs.NPM_VERSION }}
run: |
if [ $(stat -c%s "homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz") -lt 10000000 ]; then
echo "Bundle is under 10MB, stopping"
exit 1
fi
- name: Upload tar.gz Bundle to GitHub Artifacts v${{ needs.publish.outputs.NPM_VERSION }}
uses: actions/upload-artifact@v4
with:
name: 'homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz'
path: |
./homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz
- name: Upload SHASUMS256.txt to GitHub Artifacts v${{ needs.publish.outputs.NPM_VERSION }}
uses: actions/upload-artifact@v4
with:
name: 'SHASUMS256.txt'
path: |
./SHASUMS256.txt
- name: Attach Bundle v${{ needs.publish.outputs.NPM_VERSION }}
uses: AButler/[email protected]
with:
files: 'homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz;SHASUMS256.txt'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: v${{ needs.publish.outputs.NPM_VERSION }}
github-releases-to-discord:
name: Discord Webhooks
needs: [publish,pre-release-beta,attach-artifact]
uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest
with:
title: "Homebridge UI Beta Release"
description: |
Version `v${{ needs.publish.outputs.NPM_VERSION }}`
url: "https://github.com/homebridge/homebridge-config-ui-x/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }}