Implement faster lookup of PartModules. #5
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
name: Build | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 1 * *" | |
jobs: | |
check-secrets: | |
runs-on: ubuntu-latest | |
outputs: | |
have_secrets: ${{ steps.setvar.outputs.have_secrets }} | |
steps: | |
- id: setvar | |
run: | | |
if [[ "${{ secrets.SSH_PRIVATE_KEY }}" != "" ]]; \ | |
then | |
echo "::set-output name=have_secrets::true" | |
else | |
echo "No secrets, mod will not be built" | |
echo "::set-output name=have_secrets::false" | |
fi | |
build: | |
runs-on: windows-latest | |
needs: [check-secrets] | |
if: "needs.check-secrets.outputs.have_secrets == 'true' && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip build]')" | |
env: | |
DEPENDENCIES_REPO: git@github.com:dkavolis/ksp_binaries.git | |
FAKE_GAME_DIR: ${{ github.workspace }}/b | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: webfactory/ssh-agent@v0.5.4 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Checkout dependencies | |
run: | | |
git clone ${{ env.DEPENDENCIES_REPO }} ${{ env.FAKE_GAME_DIR }} | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v1.1 | |
- name: Build | |
run: | | |
cp "${{ github.workspace }}/.github/package.build.props" "${{ github.workspace }}/Directory.Build.props.user" | |
cp "${{ github.workspace }}/.github/package.config.json" "${{ github.workspace }}/config.json.user" | |
python -m buildtools replace | |
msbuild /p:Configuration=Release ${{ github.workspace }}/FerramAerospaceResearch.sln -m | |
- name: Package | |
id: package-mod | |
run: | | |
echo "::set-output name=archive::$(python -m buildtools package)" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FerramAerospaceResearch | |
path: ${{ steps.package-mod.outputs.archive }} |