Skip to content

Commit 691cf37

Browse files
committed
Improve release automation
1 parent 657342e commit 691cf37

1 file changed

Lines changed: 71 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 71 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,85 @@ 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: Set Manifest
29+
id: set_manifest
30+
run: echo "manifest=$(wally manifest-to-json)" >> $GITHUB_OUTPUT
31+
1632
build:
1733
runs-on: ubuntu-latest
1834

1935
steps:
20-
- name: Checkout
36+
- name: Checkout repository
2137
uses: actions/checkout@v6
2238

2339
# Build steps
2440
- name: Setup Rokit
25-
uses: CompeyDev/setup-rokit@v0.1.2
41+
uses: CompeyDev/setup-rokit@v0.2.1
2642
with:
2743
cache: true
2844
- name: Build
2945
run: rojo build -o Overture.rbxm
3046

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

0 commit comments

Comments
 (0)