Skip to content

Commit 2188d48

Browse files
committed
Use GH CLI for releasing instead of unmaintained package
1 parent 4400625 commit 2188d48

File tree

1 file changed

+41
-9
lines changed

1 file changed

+41
-9
lines changed

.github/workflows/publish_version.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,33 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v3
12+
1213
- uses: actions/setup-node@v3
1314
with:
1415
node-version: '18'
16+
1517
- name: Install Lua
1618
uses: leafo/gh-actions-lua@v10
19+
1720
- name: Install LuaRocks
1821
uses: leafo/gh-actions-luarocks@v4
22+
1923
- run: luarocks install dkjson
24+
2025
- name: Install dependencies
2126
run: npm ci
27+
2228
- name: Create .env file
2329
run: |
2430
touch .env
2531
echo LUAROCKS_API_KEY=${{ secrets.LUAROCKS_API_KEY }} >> .env
32+
2633
- name: Publish the rock
2734
run: npm run ci:publish
35+
2836
- name: Install Luvit
2937
run: curl -L https://github.com/luvit/lit/raw/master/get-lit.sh | sh
38+
3039
- name: Make lit and luvit available and executable
3140
run: |
3241
sudo cp lit /usr/local/bin/lit
@@ -35,10 +44,13 @@ jobs:
3544
sudo chmod +x /usr/local/bin/luvit
3645
sudo cp luvi /usr/local/bin/luvi
3746
sudo chmod +x /usr/local/bin/luvi
47+
3848
- name: Build the Lit binary
3949
run: npm run build:lit
50+
4051
- name: Rename the Lit binary
4152
run: mv ./dist/jestronaut ./dist/jestronaut-ubuntu
53+
4254
- name: Upload binary artifact
4355
uses: actions/upload-artifact@v3
4456
with:
@@ -49,18 +61,24 @@ jobs:
4961
runs-on: windows-latest
5062
steps:
5163
- uses: actions/checkout@v3
64+
5265
- uses: actions/setup-node@v3
5366
with:
5467
node-version: '18'
68+
5569
- name: Install Luvit
5670
shell: pwsh
5771
run: "[Net.ServicePointManager]::SecurityProtocol = 'Tls12'; iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/master/get-lit.ps1'))"
72+
5873
- name: Install dependencies
5974
run: npm ci
75+
6076
- name: Build the Lit binary
6177
run: npm run build:lit
78+
6279
- name: Rename the Lit binary
6380
run: mv ./dist/jestronaut.exe ./dist/jestronaut-windows.exe
81+
6482
- name: Upload binary artifact
6583
uses: actions/upload-artifact@v3
6684
with:
@@ -71,13 +89,17 @@ jobs:
7189
runs-on: ubuntu-latest
7290
steps:
7391
- uses: actions/checkout@v3
92+
7493
- uses: actions/setup-node@v3
7594
with:
7695
node-version: '18'
96+
7797
- name: Install dependencies
7898
run: npm ci
99+
79100
- name: Build the GMod addon
80101
run: npm run build:gmod
102+
81103
- name: Upload GMod addon artifact
82104
uses: actions/upload-artifact@v3
83105
with:
@@ -91,26 +113,36 @@ jobs:
91113
contents: write
92114
steps:
93115
- uses: actions/checkout@v3
116+
94117
- name: Create dist directory
95118
run: mkdir -p dist
119+
96120
- name: Download binary artifact from publish_rock_and_build_ubuntu
97121
uses: actions/download-artifact@v2
98122
with:
99123
name: jestronaut-ubuntu
100124
path: dist
125+
101126
- name: Download binary artifact from build_windows
102127
uses: actions/download-artifact@v2
103128
with:
104129
name: jestronaut-windows
105130
path: dist
131+
132+
- name: Install GitHub CLI
133+
run: |
134+
sudo apt-get update
135+
sudo apt-get install -y gh
136+
137+
- name: Authenticate GitHub CLI
138+
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
139+
106140
- name: Create a new release
107-
uses: "marvinpinto/action-automatic-releases@v1.2.1"
108-
with:
109-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
110-
automatic_release_tag: "latest"
111-
prerelease: true
112-
title: "Latest (automatic build)"
113-
files: |
114-
dist/jestronaut-ubuntu
115-
dist/jestronaut-windows.exe
141+
id: create_release
142+
run: |
143+
gh release create latest \
144+
--prerelease \
145+
--title "Latest (automatic build)" \
146+
dist/jestronaut-ubuntu \
147+
dist/jestronaut-windows.exe \
116148
dist/gmod-addon.zip

0 commit comments

Comments
 (0)