Skip to content

Commit 119f527

Browse files
authored
Merge pull request #114 from Slappy826/gh-actions-work
refactor
2 parents fb1c191 + bc0bdb1 commit 119f527

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Build Lua Distributions
22

3-
on:
4-
- push
5-
- workflow_dispatch
3+
on: [push, workflow_dispatch]
64

75
permissions:
86
contents: read
@@ -26,12 +24,8 @@ jobs:
2624
sparse-checkout: luau
2725
- name: Configure with CMake
2826
run: |
29-
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${{ matrix.os.name != 'windows' && '-ffp-contract=off' || '' }}" -DCMAKE_C_FLAGS="${{ matrix.os.name != 'windows' && '-ffp-contract=off' || '' }}"
27+
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="${{ matrix.os.name == 'macos' && 'x86_64;arm64' || '' }}" -DCMAKE_CXX_FLAGS="${{ matrix.os.name != 'windows' && '-ffp-contract=off' || '' }}" -DCMAKE_C_FLAGS="${{ matrix.os.name != 'windows' && '-ffp-contract=off' || '' }}"
3028
- name: Build with CMake
31-
env:
32-
# Create fat binary on macOS for compatibility with ARM64 and Intel
33-
# (for compatibility with older macintosh devices)
34-
CMAKE_OSX_ARCHITECTURES: ${{ matrix.os.name == 'macos' && 'x86_64;arm64' || '' }}
3529
run: |
3630
cmake --build . --target Luau.Repl.CLI Luau.Compile.CLI --config Release -j 2
3731
- name: Upload artifact
@@ -149,22 +143,43 @@ jobs:
149143
delete-merged: true
150144
compression-level: 9
151145
- name: Download merged artifact
152-
if: ${{ github.event_name == 'workflow_dispatch' }}
146+
if: github.ref == 'refs/heads/main'
153147
uses: actions/download-artifact@v7
154148
with:
155149
name: crosslua-build
156150
path: crosslua-build
157151
- name: Generate .zip file with archives
158-
if: ${{ github.event_name == 'workflow_dispatch' }}
152+
if: github.ref == 'refs/heads/main'
159153
run: zip -r -9 crosslua-build.zip crosslua-build/*
160154
- name: Create release
161-
if: ${{ github.event_name == 'workflow_dispatch' }}
155+
if: github.ref == 'refs/heads/main'
162156
uses: softprops/action-gh-release@v2
163157
with:
164-
name: CrossLua ${{ github.event.started_at }}
158+
tag_name: v${{ github.run_number }}
159+
name: CrossLua Build ${{ github.run_number }}
165160
body: This release was automatically generated by a build script.
161+
files: crosslua-build.zip
166162
fail_on_unmatched_files: true
167163
prerelease: false
168164
draft: false
169165
make_latest: true
166+
dependabot:
167+
needs: [build-luau, build-luajit, build-lua]
168+
runs-on: ubuntu-latest
169+
permissions:
170+
pull-requests: write
171+
contents: write
172+
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
173+
steps:
174+
- id: metadata
175+
uses: dependabot/fetch-metadata@v2
176+
with:
177+
github-token: "${{ secrets.GITHUB_TOKEN }}"
178+
- run: |
179+
gh pr review --approve "$PR_URL"
180+
gh pr merge --squash --auto "$PR_URL"
181+
env:
182+
PR_URL: ${{github.event.pull_request.html_url}}
183+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
184+
170185

0 commit comments

Comments
 (0)