forked from sorke/Baileys
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.16 KB
/
update-nightly.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
name: Update Nightly
permissions:
contents: write
on:
push:
branches:
- master
jobs:
update-nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetching tags
run: git fetch --tags -f || true
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 18.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn
- name: Update version to alpha
run: yarn version --prerelease --preid=alpha --no-git --no-git-tag-version
- name: Build NPM package
run: yarn pack && mv whiskeysockets-baileys-*.tgz whiskeysockets-baileys-nightly.tgz
- name: Generate Changelog
id: generate_changelog
run: |
changelog=$(yarn run --silent changelog:preview)
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "${changelog}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Update Nightly TAG
uses: richardsimko/update-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
- name: Update Nightly Release
uses: meeDamian/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly
commitish: ${{ github.sha }}
name: Nightly Release
body: ${{ steps.generate_changelog.outputs.changelog }}
draft: false
prerelease: true
files: >
whiskeysockets-baileys-nightly.tgz
gzip: folders
allow_override: true