Skip to content

Commit 834e6b8

Browse files
committed
Add Sync to Codeberg action
1 parent fd10530 commit 834e6b8

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Mirror Release to Codeberg
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
sync-to-codeberg:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Code
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Sync Code and Tags
17+
run: |
18+
git remote add codeberg "https://M-Rajabi-Dev:${{ secrets.CODEBERG_TOKEN }}@codeberg.org/M-Rajabi-Dev/AudioShelf.git"
19+
git push -f codeberg main
20+
git push -f codeberg --tags
21+
22+
- name: Download Assets from GitHub
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
run: |
26+
mkdir assets
27+
gh release download ${{ github.event.release.tag_name }} -D assets --pattern "*Setup.exe" --pattern "*Portable.zip"
28+
29+
- name: Create Release and Upload to Codeberg
30+
uses: appleboy/gitea-release-action@v1
31+
with:
32+
base_url: https://codeberg.org
33+
owner: M-Rajabi-Dev
34+
repo: AudioShelf
35+
token: ${{ secrets.CODEBERG_TOKEN }}
36+
tag_name: ${{ github.event.release.tag_name }}
37+
name: ${{ github.event.release.name }}
38+
body: ${{ github.event.release.body }}
39+
files: "assets/*"
40+
draft: false
41+
prerelease: ${{ github.event.release.prerelease }}

.github/workflows/test-fake.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Test Fake Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
fake_version:
7+
description: 'Fake Version Name (e.g. v-test-01)'
8+
required: true
9+
default: 'v-test-01'
10+
11+
jobs:
12+
test-fake-upload:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v3
17+
18+
# ۱. ساخت فایل‌های الکی برای تست آپلود
19+
- name: Create Dummy Assets
20+
run: |
21+
mkdir assets
22+
echo "This is a fake setup file for testing" > assets/Fake-Setup.exe
23+
echo "This is a fake portable zip for testing" > assets/Fake-Portable.zip
24+
25+
# ۲. ساخت تگ مصنوعی و ارسال فقط به کدبرگ
26+
- name: Push Fake Tag to Codeberg Only
27+
run: |
28+
git config --global user.name "Test Bot"
29+
git config --global user.email "[email protected]"
30+
31+
git remote add codeberg "https://M-Rajabi-Dev:${{ secrets.CODEBERG_TOKEN }}@codeberg.org/M-Rajabi-Dev/AudioShelf.git"
32+
33+
# ساخت تگ روی همین کامیت فعلی
34+
git tag ${{ inputs.fake_version }}
35+
36+
# ارسال تگ به کدبرگ (کاری به گیت‌هاب نداریم)
37+
git push -f codeberg ${{ inputs.fake_version }}
38+
39+
# ۳. تست آپلود فایل با پلاگین اصلی
40+
- name: Upload Fake Assets to Codeberg
41+
uses: appleboy/gitea-release-action@v1
42+
with:
43+
base_url: https://codeberg.org
44+
owner: M-Rajabi-Dev
45+
repo: AudioShelf
46+
token: ${{ secrets.CODEBERG_TOKEN }}
47+
tag_name: ${{ inputs.fake_version }}
48+
name: "TEST RELEASE ${{ inputs.fake_version }}"
49+
body: "This is a test release. You can delete it safely."
50+
files: "assets/*"
51+
draft: false
52+
prerelease: true

0 commit comments

Comments
 (0)