Skip to content

pull r4e

pull r4e #97

Workflow file for this run

name: Build Workflow
on: [ push, pull_request ]
jobs:
build:
name: Build (${{ matrix.config }})
runs-on: windows-latest
permissions:
contents: write
strategy:
matrix:
config: [ Debug, RelWithDebInfo ]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ilammy/[email protected]
with:
arch: amd64
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_CI_BUILD=ON -DGITHUB_ENV="$env:GITHUB_ENV" -G Ninja
- name: Build
id: build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }}
- name: Get short SHA
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV
- name: Create environment variables
run: |
$config = "${{ matrix.config }}"
if ($config -eq "RelWithDebInfo") {
$config = "release"
}
else {
$config = $config.ToLower()
}
echo "PRETTY_CONFIG=${config}" | Out-File -FilePath $env:GITHUB_ENV -Encoding UTF8 -Append
- name: Upload game_dir with zip file name
uses: actions/upload-artifact@v3
with:
name: ${{ env.MOD_ZIP_FILENAME }}_${{ env.PRETTY_CONFIG }}_${{ env.SHORT_SHA }}
path: ${{ github.workspace }}/game_dir/**
- name: Upload game_dir_debug with zip file name
uses: actions/upload-artifact@v3
with:
name: ${{ env.MOD_ZIP_FILENAME }}_${{ env.PRETTY_CONFIG }}_${{ env.SHORT_SHA }}_pdb
path: ${{ github.workspace }}/game_dir_debug/**
- name: Upload game_dir_requirements with zip file name
uses: actions/upload-artifact@v3
with:
name: ${{ env.MOD_ZIP_FILENAME }}_${{ env.PRETTY_CONFIG }}_${{ env.SHORT_SHA }}_requirements
path: ${{ github.workspace }}/game_dir_requirements/**
- name: Upload game_dir_requirements_debug with zip file name
uses: actions/upload-artifact@v3
with:
name: ${{ env.MOD_ZIP_FILENAME }}_${{ env.PRETTY_CONFIG }}_${{ env.SHORT_SHA }}_requirements_pdb
path: ${{ github.workspace }}/game_dir_requirements_debug/**
- name: 'Version Badge'
if: always()
run: |
mkdir badge
echo '{"cp_version":{"label":"Cyberpunk 2077","status":"${{ env.CYBERPUNK_2077_GAME_VERSION }}","color":"${{ steps.build.outcome == 'success' && '31b75d' || 'red' }}"}}' > badge/shields.json
- name: Push shields branch
if: github.ref == 'refs/heads/main'
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: shields
FOLDER: badge
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}