-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (93 loc) · 3.2 KB
/
update.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
109
110
111
112
113
114
115
name: update
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
permissions: write-all
jobs:
check:
runs-on: ubuntu-latest
outputs:
updated: ${{ steps.update-result.outputs.updated }}
steps:
- name: Check out Repository
uses: actions/checkout@v2
with:
ref: automatic-updates
- name: Install Foreman
uses: Roblox/setup-foreman@v1
with:
version: "^1.0.0"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo-make
uses: davidB/rust-cargo-make@v1
- name: Download version file
run: cargo make download-version-file
- name: Update package
run: remodel run update-package.remodel.lua check
- id: update-result
run: |
if test -f "no-changes"; then
echo "::set-output name=updated::false"
else
echo "::set-output name=updated::true"
fi
shell: bash
update:
needs: check
if: needs.check.outputs.updated == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out Repository
uses: actions/checkout@v2
with:
ref: automatic-updates
- name: Install Foreman
uses: Roblox/setup-foreman@v1
with:
version: "^1.0.0"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo-make
uses: davidB/rust-cargo-make@v1
- name: Update types
run: cargo make download-api-dump
- name: Configure git
run: |
git config --global user.name 'Automated Updates'
git config --global user.email '[email protected]'
- name: Update package
run: remodel run update-package.remodel.lua
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set variables
run: |
PACKAGE_VERSION=$(cat package-version.txt)
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
PREV_PACKAGE_VERSION=$(cat previous-package-version.txt)
echo "PREV_PACKAGE_VERSION=$PREV_PACKAGE_VERSION" >> $GITHUB_ENV
- name: Push changes
run: |
git add -A
git commit -m "Update to v${{ env.PACKAGE_VERSION }}"
git tag -fa v${{ env.PACKAGE_VERSION }} -m "auto-update"
git tag -fa latest-v1 -m "auto-update to v${{ env.PACKAGE_VERSION }}"
git push
git push origin latest-v1 -f
- name: Update release
run: gh release edit latest-v1 --tag latest-v1 --target automatic-updates --title "Latest (v${{ env.PACKAGE_VERSION }})"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build library
run: rojo build -o ApiDumpStatic.rbxm default.project.json
- name: Upload release asset
run: gh release upload latest-v1 ApiDumpStatic.rbxm --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to wally
env:
WALLY_AUTH: ${{ secrets.WALLY_AUTH }}
run: |
mkdir ~/.wally
printenv WALLY_AUTH > ~/.wally/auth.toml
- name: Push update to wally
run: wally publish