|
1 | 1 | name: Build Lua Distributions |
2 | 2 |
|
3 | | -on: |
4 | | - - push |
5 | | - - workflow_dispatch |
| 3 | +on: [push, workflow_dispatch] |
6 | 4 |
|
7 | 5 | permissions: |
8 | 6 | contents: read |
|
26 | 24 | sparse-checkout: luau |
27 | 25 | - name: Configure with CMake |
28 | 26 | 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' || '' }}" |
30 | 28 | - 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' || '' }} |
35 | 29 | run: | |
36 | 30 | cmake --build . --target Luau.Repl.CLI Luau.Compile.CLI --config Release -j 2 |
37 | 31 | - name: Upload artifact |
@@ -149,22 +143,43 @@ jobs: |
149 | 143 | delete-merged: true |
150 | 144 | compression-level: 9 |
151 | 145 | - name: Download merged artifact |
152 | | - if: ${{ github.event_name == 'workflow_dispatch' }} |
| 146 | + if: github.ref == 'refs/heads/main' |
153 | 147 | uses: actions/download-artifact@v7 |
154 | 148 | with: |
155 | 149 | name: crosslua-build |
156 | 150 | path: crosslua-build |
157 | 151 | - name: Generate .zip file with archives |
158 | | - if: ${{ github.event_name == 'workflow_dispatch' }} |
| 152 | + if: github.ref == 'refs/heads/main' |
159 | 153 | run: zip -r -9 crosslua-build.zip crosslua-build/* |
160 | 154 | - name: Create release |
161 | | - if: ${{ github.event_name == 'workflow_dispatch' }} |
| 155 | + if: github.ref == 'refs/heads/main' |
162 | 156 | uses: softprops/action-gh-release@v2 |
163 | 157 | with: |
164 | | - name: CrossLua ${{ github.event.started_at }} |
| 158 | + tag_name: v${{ github.run_number }} |
| 159 | + name: CrossLua Build ${{ github.run_number }} |
165 | 160 | body: This release was automatically generated by a build script. |
| 161 | + files: crosslua-build.zip |
166 | 162 | fail_on_unmatched_files: true |
167 | 163 | prerelease: false |
168 | 164 | draft: false |
169 | 165 | 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 | +
|
170 | 185 | |
0 commit comments