-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add workflow to automate the rebase and tag
- Loading branch information
Showing
2 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Rebase and tag | ||
|
||
on: | ||
workflow_dispatch: | ||
# inputs: | ||
# sync_test_mode: # Adds a boolean option that appears during manual workflow run for easy test mode config | ||
# description: 'Test Mode' | ||
# type: boolean | ||
# default: false | ||
|
||
jobs: | ||
sync_latest_from_upstream: | ||
name: Sync latest commits from upstream repo and tag | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
- name: checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: build-apk | ||
fetch-depth: 0 | ||
|
||
- name: Sync upstream changes | ||
id: sync | ||
uses: aormsby/[email protected] | ||
with: | ||
target_sync_branch: build-apk | ||
# REQUIRED 'target_repo_token' exactly like this! | ||
target_repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
target_branch_push_args: '--force' | ||
upstream_sync_branch: main | ||
upstream_sync_repo: olvid-io/olvid-android | ||
upstream_pull_args: '--rebase --tags' | ||
|
||
# Set test_mode true during manual dispatch to run tests instead of the true action!! | ||
test_mode: ${{ inputs.sync_test_mode }} | ||
|
||
- name: New commits found | ||
if: steps.sync.outputs.has_new_commits == 'true' | ||
run: echo "New commits were found to sync." | ||
|
||
- name: No new commits | ||
if: steps.sync.outputs.has_new_commits == 'false' | ||
run: echo "There were no new commits." | ||
|
||
- name: Show value of 'has_new_commits' | ||
run: echo ${{ steps.sync.outputs.has_new_commits }} | ||
|
||
- name: 'Get Previous tag' | ||
if: steps.sync.outputs.has_new_commits == 'true' | ||
id: previoustag | ||
uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
|
||
- name: Bump version and push tag | ||
if: steps.sync.outputs.has_new_commits == 'true' | ||
uses: EndBug/latest-tag@latest | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
ref: "${{ steps.previoustag.outputs.tag }}-kumy1" | ||
|
||
- name: Trigger build | ||
if: steps.sync.outputs.has_new_commits == 'true' | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
run: | | ||
gh workflow run android.yml \ | ||
-R kumy/olvid-android \ | ||
-F "ref=refs/tags/${{ steps.previoustag.outputs.tag }}-kumy1" |