Skip to content

Commit 8b82ee9

Browse files
committed
Improve release automation
1 parent 657342e commit 8b82ee9

1 file changed

Lines changed: 76 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ name: Build and Publish Binaries
22
run-name: Release binaries for ${{ github.ref_name }} by @${{ github.actor }}
33

44
on:
5-
release:
6-
types: [created]
5+
workflow_dispatch:
6+
push:
7+
paths:
8+
- "wally.toml"
79

810
permissions:
911
contents: write
@@ -13,23 +15,90 @@ concurrency:
1315
cancel-in-progress: true
1416

1517
jobs:
18+
manifest:
19+
runs-on: ubuntu-latest
20+
21+
outputs:
22+
version: ${{ fromJSON(steps.set_manifest.outputs.manifest).package.version }}
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v6
27+
28+
- name: Setup Rokit
29+
uses: CompeyDev/setup-rokit@v0.2.1
30+
with:
31+
cache: true
32+
33+
- name: Set Manifest
34+
id: set_manifest
35+
run: echo "manifest=$(wally manifest-to-json)" >> $GITHUB_OUTPUT
36+
1637
build:
1738
runs-on: ubuntu-latest
1839

1940
steps:
20-
- name: Checkout
41+
- name: Checkout repository
2142
uses: actions/checkout@v6
2243

2344
# Build steps
2445
- name: Setup Rokit
25-
uses: CompeyDev/setup-rokit@v0.1.2
46+
uses: CompeyDev/setup-rokit@v0.2.1
2647
with:
2748
cache: true
2849
- name: Build
2950
run: rojo build -o Overture.rbxm
3051

3152
# Upload steps
32-
- name: Release
33-
uses: softprops/action-gh-release@v2
53+
- name: Upload build
54+
uses: actions/upload-artifact@v7
3455
with:
35-
files: Overture.rbxm
56+
path: "*.rbxm"
57+
if-no-files-found: error
58+
59+
publish-github:
60+
if: github.ref == 'refs/heads/main' || (contains(needs.manifest.outputs.version, '-') && github.event_name == 'workflow_dispatch')
61+
62+
needs: [build, manifest]
63+
runs-on: ubuntu-latest
64+
65+
permissions:
66+
contents: write
67+
68+
steps:
69+
- name: Download
70+
uses: actions/download-artifact@v7
71+
72+
- uses: ncipollo/release-action@v1
73+
with:
74+
name: ${{ needs.manifest.outputs.version }}
75+
tag: v${{ needs.manifest.outputs.version }}
76+
commit: ${{ github.head_ref || github.ref_name }}
77+
artifacts: "**/*.rbxm"
78+
prerelease: ${{ contains(needs.manifest.outputs.version, '-') }}
79+
generateReleaseNotes: true
80+
81+
publish-wally:
82+
needs: [build, publish-github]
83+
runs-on: ubuntu-latest
84+
85+
steps:
86+
- name: Checkout repository
87+
uses: actions/checkout@v6
88+
89+
- name: Setup Rokit
90+
uses: CompeyDev/setup-rokit@v0.1.2
91+
with:
92+
cache: true
93+
94+
- name: Log in to wally
95+
env:
96+
WALLY_AUTH: |
97+
[tokens]
98+
"https://api.wally.run/" = "${{ secrets.WALLY_AUTH }}"
99+
run: |
100+
mkdir ~/.wally
101+
printenv WALLY_AUTH > ~/.wally/auth.toml
102+
103+
- name: Push update to wally
104+
run: wally publish

0 commit comments

Comments
 (0)