generated from ZL-Audio/ZLTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (60 loc) · 1.91 KB
/
sync_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Release Sync
on:
workflow_dispatch:
# workflow_run:
# workflows: [Release]
# types: [completed]
jobs:
build:
name: Release Sync
if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout current repo
uses: actions/checkout@v4
with:
submodules: false
path: "current_repo"
- name: Download release repo
uses: actions/checkout@v4
with:
repository: "ZL-Audio/ZLRelease"
fetch-depth: 0
path: "release_repo"
ssh-key: ${{ secrets.SSH_RELEASE_DEPLOY_KEY }}
- name: Download current release assets (macOS)
uses: robinraju/[email protected]
with:
latest: true
preRelease: true
fileName: "*dmg"
out-file-path: "current_release"
- name: Download current release assets (Windows)
uses: robinraju/[email protected]
with:
latest: true
preRelease: true
fileName: "*exe"
out-file-path: "current_release"
- name: Remove old release assets
run: |
rm -rf "release_repo/${{ github.event.repository.name }}"
mkdir -p "release_repo/${{ github.event.repository.name }}"
ls "current_release/"
- name: Move current release assets
run: |
mv -v "current_release"/* "release_repo/${{ github.event.repository.name }}/"
mv -v "current_repo/CHANGELOG.md" "release_repo/${{ github.event.repository.name }}/README.md"
- name: Commit release repo
run: |
cd "release_repo"
git config user.name github-actions
git config user.email [email protected]
git checkout --orphan newBranch
git add -A
git commit -m "release"
git branch -D main
git branch -m main
git push -f origin main