-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
82 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build nightly release | ||
|
||
on: | ||
schedule: | ||
- cron: '0 12 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update_submodules: | ||
uses: ./.github/workflows/update-submodules.yml | ||
|
||
update_definitions: | ||
uses: ./.github/workflows/update-definitions.yml | ||
|
||
upload: | ||
name: Upload definitions | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Clone definitions | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: dist | ||
sparse-checkout-cone-mode: false | ||
|
||
- name: Upload as artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dfhack-lua-definitions | ||
path: dist | ||
compression-level: 9 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
name: Build | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Generate Annotations | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec rake | ||
# TODO: Improve testing. | ||
continue-on-error: true | ||
- name: Build annotations | ||
|
||
- name: Run Rspec | ||
run: bundle exec rake | ||
|
||
- name: Generate definitions | ||
run: bundle exec rake build | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dfhack-lua-definitions | ||
path: dist | ||
compression-level: 9 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Update definitions | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
run: | ||
name: Update definitions | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Generate definitions | ||
run: rake build | ||
|
||
- name: Check if definitions changed | ||
id: definitions_changed | ||
run: echo "changed=$(git diff --quiet HEAD -- dist; echo $?)" >> $GITHUB_OUTPUT | ||
|
||
- name: Setup git user | ||
if: ${{ steps.definitions_changed.outputs.changed == true }} | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
- name: Commit changes | ||
if: ${{ steps.definitions_changed.outputs.changed == true }} | ||
run: | | ||
git add dist | ||
git commit -m "Auto-update definitions" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,16 +12,20 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Update submodules | ||
run: git submodule update --remote | ||
|
||
- name: Check if submodules updated | ||
id: submodules_updated | ||
run: echo "changed=$(git diff --quiet HEAD -- dfhack df-structures; echo $?)" >> $GITHUB_OUTPUT | ||
|
||
- name: Setup git user | ||
if: ${{ steps.submodules_updated.outputs.changed == true }} | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
- name: Commit changes | ||
if: ${{ steps.submodules_updated.outputs.changed == true }} | ||
run: | | ||
|