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

Automatically update protos #1027

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions .github/workflows/update-protobufs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Update Protobufs

on:
workflow_dispatch:
push:
branches:
- yaakov/auto-protos # temporary trigger during development
#schedule:
#- cron: '0 17 * * SUN'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just dropping a comment for this to be uncommented once we're ready to merge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also add workflow_dispatch: to be able to manually trigger this from UI.


permissions:
contents: write
pull-requests: write

jobs:
update-protobufs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/[email protected]
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
2 changes: 1 addition & 1 deletion Resources/ProtobufGen/generate-all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading