Skip to content

Commit

Permalink
Use a bot author and only publish if there were changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim203 committed May 10, 2024
1 parent 9cd5400 commit f04278b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/sync-publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
name: Sync and publish to Github Packages
name: Sync and publish to opencollab repo

on:
schedule:
- cron: '1 18 * * *'
workflow_dispatch:
inputs:
sync_test_mode:
description: 'Test fork sync config'
type: boolean
default: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: dabreadman/[email protected]
with:
upstream_repo: https://github.com/SpigotMC/BungeeCord.git
upstream_branch: master
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Sync upstream changes
id: sync
uses: aormsby/[email protected]
with:
target_sync_branch: master
target_repo_token: ${{ secrets.GITHUB_TOKEN }}
upstream_sync_repo: SpigotMC/BungeeCord
upstream_sync_branch: master
test_mode: ${{ inputs.sync_test_mode }}
- uses: actions/setup-java@v4
if: steps.sync.outputs.has_new_commits == 'true'
with:
java-version: 8
distribution: zulu
server-id: opencollab
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
if: steps.sync.outputs.has_new_commits == 'true'
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit f04278b

Please sign in to comment.