Skip to content

Commit

Permalink
internal: modernize deploy workflow (skyrim-multiplayer#1926)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove authored Apr 20, 2024
1 parent fed1223 commit 8e90609
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 413 deletions.
66 changes: 28 additions & 38 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,63 +54,53 @@ jobs:
submodules: recursive
fetch-depth: 0

- name: Checkout skymp5-patches (full)
if: ${{env.DEPLOY_ACTION == 'deploy'}}
# # https://github.com/actions/checkout/issues/197#issuecomment-971545044
uses: Pospelove/checkout@main
with:
repository: skyrim-multiplayer/skymp5-patches
submodules: recursive
fetch-depth: 0
token: ${{ secrets.SKYMP5_PATCHES_PAT }}
path: /home/runner/work/skymp5-patches
ref: main

- name: Checkout (last commit)
if: ${{env.DEPLOY_ACTION != 'deploy'}}
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Gather PRs
if: ${{env.DEPLOY_ACTION == 'deploy'}}
env:
DEPLOY_STATUS_WEBHOOK: ${{secrets.DEPLOY_STATUS_WEBHOOK}}
uses: Pospelove/auto-merge-action@main
with:
path: ${{github.workspace}}
repositories: |
[
{
"owner": "skyrim-multiplayer",
"repo": "skymp",
"labels": ["merge-to:${{env.DEPLOY_BRANCH}}"]
},
{
"owner": "skyrim-multiplayer",
"repo": "skymp5-patches",
"labels": ["merge-to:${{env.DEPLOY_BRANCH}}"],
"token": "${{secrets.SKYMP5_PATCHES_PAT}}"
}
]
- name: Calculate diff being deployed
if: ${{env.DEPLOY_ACTION == 'deploy'}}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config pull.rebase false
base_rev="`git rev-parse HEAD`"
echo "=== Base revision: $base_rev"
git checkout -b tmp
yarn --cwd="${{github.workspace}}/misc/deploy/gather-server-branch"
./misc/deploy/gather_server_branch.sh
git remote add patches /home/runner/work/skymp5-patches
git fetch patches
git merge patches/main --no-edit
echo ""
echo "=== Changes since $base_rev:"
git log -p "$base_rev.." | tee deploy_git_log
echo ""
echo "=== Full diff being deployed:"
git diff "$base_rev" | tee deploy_git_diff
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git add .
git commit -m "Temporary commit for diff"
git diff HEAD~1 | tee deploy_git_diff
- name: Upload patches
- name: Upload diff artifact
if: ${{env.DEPLOY_ACTION == 'deploy'}}
uses: actions/upload-artifact@v3
with:
name: patches
path: |
deploy_git_log
deploy_git_diff
- name: Post link
- name: Post a link in Discord
if: ${{env.DEPLOY_ACTION == 'deploy'}}
env:
DEPLOY_STATUS_WEBHOOK: ${{secrets.DEPLOY_STATUS_WEBHOOK}}
Expand Down
1 change: 0 additions & 1 deletion misc/deploy/gather-server-branch/.gitignore

This file was deleted.

30 changes: 0 additions & 30 deletions misc/deploy/gather-server-branch/list_included_pulls.ts

This file was deleted.

15 changes: 0 additions & 15 deletions misc/deploy/gather-server-branch/package.json

This file was deleted.

33 changes: 0 additions & 33 deletions misc/deploy/gather-server-branch/pull_manager.ts

This file was deleted.

5 changes: 0 additions & 5 deletions misc/deploy/gather-server-branch/tsconfig.json

This file was deleted.

Loading

0 comments on commit 8e90609

Please sign in to comment.