diff --git a/.github/workflows/update-protobufs.yaml b/.github/workflows/update-protobufs.yaml new file mode 100644 index 000000000..158217344 --- /dev/null +++ b/.github/workflows/update-protobufs.yaml @@ -0,0 +1,39 @@ +name: Update Protobufs + +on: + workflow_dispatch: + push: + branches: + - yaakov/auto-protos # temporary trigger during development + #schedule: + #- cron: '0 17 * * SUN' + +permissions: + contents: write + pull-requests: write + +jobs: + update-protobufs: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2.3.4 + with: + submodules: true + + - name: Run update script + shell: pwsh + run: Resources/ProtobufGen/update.ps1 + + # TODO: We need a new GitHub Machine Account (or maybe an existing one?) to generate a PAT that we can use as the token here + # otherwise, our new changes will not trigger further Actions (on:push or on:pull_request, i.e. CI/CD builds). + #- name: Create Pull Request + # uses: peter-evans/create-pull-request@v6 + # with: + # #token: ${{ secrets.PAT }} + # commit-message: Update protobufs + # title: Update protobufs + # body: | + # - Update protobufs + # branch: auto/protobufs diff --git a/Resources/ProtobufGen/generate-all.ps1 b/Resources/ProtobufGen/generate-all.ps1 index daa8b1b96..7aa9f3be1 100644 --- a/Resources/ProtobufGen/generate-all.ps1 +++ b/Resources/ProtobufGen/generate-all.ps1 @@ -13,7 +13,7 @@ param([string[]]$ProtoDir) $ProtoGenSrc = Join-Path $PSScriptRoot 'ProtobufGen' $ProtoGenDll = Join-Path $ProtoGenSrc '\bin\Debug\ProtobufGen.dll' -$ProtoBase = Join-Path $PSScriptRoot '..\ProtoBufs' +$ProtoBase = Join-Path $PSScriptRoot '..\Protobufs' $SK2Base = Join-Path $PSScriptRoot '..\..\SteamKit2\SteamKit2\Base\Generated' & dotnet build --configuration Debug $ProtoGenSrc