Skip to content

Release Sync

Release Sync #8

Workflow file for this run

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