Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make target repos in github workflows configurable #4473

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ name: Build linux64
on:
workflow_call:
inputs:
dfhack_repo:
type: string
default: DFHack/dfhack
dfhack_ref:
type: string
scripts_repo:
type: string
default: DFHack/scripts
scripts_ref:
type: string
structures_repo:
type: string
default: DFHack/df-structures
structures_ref:
type: string
artifact-name:
Expand Down Expand Up @@ -80,22 +89,22 @@ jobs:
- name: Clone DFHack
uses: actions/checkout@v4
with:
repository: ${{ inputs.dfhack_ref && format('{0}/dfhack', github.repository_owner) || 'DFHack/dfhack' }}
repository: ${{ inputs.dfhack_repo }}
ref: ${{ inputs.dfhack_ref }}
submodules: true
fetch-depth: ${{ !inputs.platform-files && 1 || 0 }}
- name: Clone scripts
if: inputs.scripts_ref
uses: actions/checkout@v4
with:
repository: ${{ inputs.scripts_ref && github.repository || 'DFHack/scripts' }}
repository: ${{ inputs.scripts_repo }}
ref: ${{ inputs.scripts_ref }}
path: scripts
- name: Clone structures
if: inputs.structures_ref
uses: actions/checkout@v4
with:
repository: ${{ inputs.structures_ref && github.repository || 'DFHack/df-structures' }}
repository: ${{ inputs.structures_repo }}
ref: ${{ inputs.structures_ref }}
path: library/xml
- name: Get 3rd party SDKs
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ name: Build win64
on:
workflow_call:
inputs:
dfhack_repo:
type: string
default: DFHack/dfhack
dfhack_ref:
type: string
scripts_repo:
type: string
default: DFHack/scripts
scripts_ref:
type: string
structures_repo:
type: string
default: DFHack/df-structures
structures_ref:
type: string
artifact-name:
Expand Down Expand Up @@ -58,22 +67,22 @@ jobs:
- name: Clone DFHack
uses: actions/checkout@v4
with:
repository: ${{ inputs.dfhack_ref && format('{0}/dfhack', github.repository_owner) || 'DFHack/dfhack' }}
repository: ${{ inputs.dfhack_repo }}
ref: ${{ inputs.dfhack_ref }}
submodules: true
fetch-depth: 0
- name: Clone scripts
if: inputs.scripts_ref
uses: actions/checkout@v4
with:
repository: ${{ inputs.scripts_ref && github.repository || 'DFHack/scripts' }}
repository: ${{ inputs.scripts_repo }}
ref: ${{ inputs.scripts_ref }}
path: scripts
- name: Clone structures
if: inputs.structures_ref
uses: actions/checkout@v4
with:
repository: ${{ inputs.structures_ref && github.repository || 'DFHack/df-structures' }}
repository: ${{ inputs.structures_repo }}
ref: ${{ inputs.structures_ref }}
path: library/xml
- name: Get 3rd party SDKs
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ jobs:
test:
uses: ./.github/workflows/test.yml
with:
dfhack_repo: ${{ github.repository }}
dfhack_ref: ${{ github.ref }}
secrets: inherit

package:
uses: ./.github/workflows/package.yml
with:
dfhack_repo: ${{ github.repository }}
dfhack_ref: ${{ github.ref }}
secrets: inherit

docs:
uses: ./.github/workflows/build-linux.yml
with:
dfhack_repo: ${{ github.repository }}
dfhack_ref: ${{ github.ref }}
platform-files: false
common-files: false
Expand All @@ -27,6 +30,7 @@ jobs:
lint:
uses: ./.github/workflows/lint.yml
with:
dfhack_repo: ${{ github.repository }}
dfhack_ref: ${{ github.ref }}
secrets: inherit

Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/generate-symbols.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
workflow_dispatch:
inputs:
structures_ref:
description: Structures branch to update
description: Structures branch to build from and update
required: true
default: master
version:
description: DF version
required: true
Expand All @@ -22,7 +23,7 @@ on:
description: DF distribution channel
type: choice
required: true
default: steam
default: all
options:
- all
- steam
Expand All @@ -32,14 +33,15 @@ on:
description: DF Steam branch to read from (if processing Steam distribution channel)
required: true
type: choice
default: beta
default: default
options:
- default
- testing
- beta
steam_branch:
description: DFHack Steam branch to deploy to (leave blank to skip deploy)
type: string
default: staging

jobs:
package:
Expand Down Expand Up @@ -72,7 +74,6 @@ jobs:
- name: Clone structures
uses: actions/checkout@v4
with:
repository: DFHack/df-structures
ref: ${{ inputs.structures_ref }}
token: ${{ secrets.DFHACK_GITHUB_TOKEN }}
path: xml
Expand Down Expand Up @@ -174,7 +175,6 @@ jobs:
- name: Clone structures
uses: actions/checkout@v4
with:
repository: DFHack/df-structures
ref: ${{ inputs.structures_ref }}
token: ${{ secrets.DFHACK_GITHUB_TOKEN }}
path: xml
Expand Down Expand Up @@ -275,7 +275,6 @@ jobs:
- name: Clone DFHack
uses: actions/checkout@v4
with:
repository: DFHack/dfhack
submodules: true
- name: Update ref
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ name: Lint
on:
workflow_call:
inputs:
dfhack_repo:
type: string
default: DFHack/dfhack
dfhack_ref:
type: string
scripts_repo:
type: string
default: DFHack/scripts
scripts_ref:
type: string

Expand All @@ -19,7 +25,7 @@ jobs:
- name: Clone DFHack
uses: actions/checkout@v4
with:
repository: ${{ inputs.dfhack_ref && format('{0}/dfhack', github.repository_owner) || 'DFHack/dfhack' }}
repository: ${{ inputs.dfhack_repo }}
ref: ${{ inputs.dfhack_ref }}
- name: Get scripts submodule ref
if: '!inputs.scripts_ref'
Expand All @@ -28,7 +34,7 @@ jobs:
- name: Clone scripts
uses: actions/checkout@v4
with:
repository: ${{ inputs.scripts_ref && github.repository || 'DFHack/scripts' }}
repository: ${{ inputs.scripts_repo }}
ref: ${{ inputs.scripts_ref || steps.scriptssubmoduleref.outputs.ref }}
path: scripts
- name: Check whitespace
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ name: Package
on:
workflow_call:
inputs:
dfhack_repo:
type: string
dfhack_ref:
type: string
scripts_repo:
type: string
scripts_ref:
type: string
structures_repo:
type: string
structures_ref:
type: string
append-date-and-hash:
Expand All @@ -32,8 +38,11 @@ jobs:
uses: ./.github/workflows/build-windows.yml
if: inputs.include_windows
with:
dfhack_repo: ${{ inputs.dfhack_repo }}
dfhack_ref: ${{ inputs.dfhack_ref }}
scripts_repo: ${{ inputs.scripts_repo }}
scripts_ref: ${{ inputs.scripts_ref }}
structures_repo: ${{ inputs.structures_repo }}
structures_ref: ${{ inputs.structures_ref }}
artifact-name: dfhack-windows64-build
append-date-and-hash: ${{ inputs.append-date-and-hash }}
Expand All @@ -50,8 +59,11 @@ jobs:
uses: ./.github/workflows/build-linux.yml
if: inputs.include_linux
with:
dfhack_repo: ${{ inputs.dfhack_repo }}
dfhack_ref: ${{ inputs.dfhack_ref }}
scripts_repo: ${{ inputs.scripts_repo }}
scripts_ref: ${{ inputs.scripts_ref }}
structures_repo: ${{ inputs.structures_repo }}
structures_ref: ${{ inputs.structures_ref }}
artifact-name: dfhack-linux64-build
append-date-and-hash: ${{ inputs.append-date-and-hash }}
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ name: Test
on:
workflow_call:
inputs:
dfhack_repo:
type: string
default: DFHack/dfhack
dfhack_ref:
type: string
scripts_repo:
type: string
scripts_ref:
type: string
structures_repo:
type: string
structures_ref:
type: string

Expand All @@ -15,8 +22,11 @@ jobs:
name: Windows MSVC
uses: ./.github/workflows/build-windows.yml
with:
dfhack_repo: ${{ inputs.dfhack_repo }}
dfhack_ref: ${{ inputs.dfhack_ref }}
scripts_repo: ${{ inputs.scripts_repo }}
scripts_ref: ${{ inputs.scripts_ref }}
structures_repo: ${{ inputs.structures_repo }}
structures_ref: ${{ inputs.structures_ref }}
artifact-name: test-msvc
cache-id: test
Expand All @@ -28,8 +38,11 @@ jobs:
name: Linux gcc-${{ matrix.gcc }}
uses: ./.github/workflows/build-linux.yml
with:
dfhack_repo: ${{ inputs.dfhack_repo }}
dfhack_ref: ${{ inputs.dfhack_ref }}
scripts_repo: ${{ inputs.scripts_repo }}
scripts_ref: ${{ inputs.scripts_ref }}
structures_repo: ${{ inputs.structures_repo }}
structures_ref: ${{ inputs.structures_ref }}
artifact-name: test-gcc-${{ matrix.gcc }}
cache-id: test
Expand Down Expand Up @@ -89,7 +102,7 @@ jobs:
- name: Clone DFHack
uses: actions/checkout@v4
with:
repository: ${{ inputs.dfhack_ref && format('{0}/dfhack', github.repository_owner) || 'DFHack/dfhack' }}
repository: ${{ inputs.dfhack_repo }}
ref: ${{ inputs.dfhack_ref }}
- name: Detect DF version
shell: bash
Expand Down