From ecd19528e3d7790604ef35570462b1cf594667df Mon Sep 17 00:00:00 2001 From: Azalea Date: Tue, 12 May 2026 01:58:19 +0000 Subject: [PATCH] [O] Default allow changing branch rules --- .github/workflows/build.yml | 30 ++++- README.md | 9 +- src/config.rs | 6 + src/interactive.rs | 1 + src/provider.rs | 50 ++++++++ src/sync.rs | 199 +++++++++++++++++++++++++++++- tests/unit/config.rs | 48 +++++++ tests/unit/interactive.rs | 6 + tests/unit/interactive_test_io.rs | 1 + tests/unit/provider.rs | 113 +++++++++++++++++ tests/unit/sync.rs | 80 ++++++++++++ tests/unit/webhook.rs | 4 + 12 files changed, 541 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d42ea6c..c5484ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,12 @@ name: Build executables "on": + release: + types: + - published push: branches: - main - tags: - - "v*" pull_request: workflow_dispatch: @@ -148,3 +149,28 @@ jobs: name: ${{ env.BIN_NAME }}-linux-${{ matrix.arch }}-musl path: ${{ env.BIN_NAME }}-linux-${{ matrix.arch }}-musl.tar.gz if-no-files-found: error + + release-assets: + name: Attach release assets + runs-on: ubuntu-latest + needs: + - windows-x86_64 + - macos-universal + - linux-musl + if: github.event_name == 'release' + permissions: + contents: write + steps: + - name: Download packaged binaries + uses: actions/download-artifact@v4 + with: + path: release-assets + merge-multiple: true + + - name: Attach binaries to release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event.release.tag_name }} + files: release-assets/* + fail_on_unmatched_files: true + overwrite_files: true diff --git a/README.md b/README.md index 54e699b..3c1b713 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Created becasue github is so unusable and [unreliable](https://red-squares.cian. - **read-write mirrors**: Make changes from any provider, and the changes will sync to the others - **webhook support**: Sync right after push, reduce potential divergence window - **conflict handling**: Rebase or open pull requests when two platforms diverge -- **tracks deletions**: Branches/repo deletions sync across platforms (with backup) +- **tracks state**: Branches/repo deletions and force pushes also sync across platforms (with backup) - **selective sync**: Sync subset of repos by regex white/black list, or by private/public visibility - **multithreaded**: Process multiple repos simultaneously! @@ -210,6 +210,11 @@ refray webhook update https://new.example.com/webhook Issues and pull requests are not mirrored. +## TODO + +- [ ] Sync releases and released assets + +