-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make update-mirror.yml trigger builds on new tags #12
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,33 @@ jobs: | |
fetch-depth: 0 | ||
ref: upstream/master | ||
|
||
- name: Update mirror | ||
- name: Fetch updates from official repository | ||
run: | | ||
git config pull.ff only | ||
git remote add official git://git.kitenet.net/git-annex | ||
git pull --tags official master | ||
git push --tags origin upstream/master | ||
|
||
- name: Determine new tags | ||
run: | | ||
comm -23 <(git tag | sort) \ | ||
<(git ls-remote --tags --refs origin \ | ||
| awk '{print $2}' \ | ||
| xargs git for-each-ref --format '%(refname:strip=2)' \ | ||
| sort) > new-tags.txt | ||
|
||
- name: Push new objects to mirror | ||
run: git push --tags origin upstream/master | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's just push There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yarikoptic So are you expecting the build workflows to only ever be manually/programmatically dispatched using tags, not commit hashes or other refspecs? The build workflows will need to be edited to pull the input tags from the official repository and then push them at the end, something that doesn't apply to general commitishes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, right, I see... oh well, then let's keep as is to keep it simple(r) for now |
||
|
||
- name: Trigger workflow runs for new tags | ||
run: | | ||
while read tag | ||
do for workflow in build-macos.yaml build-ubuntu.yaml build-windows.yaml | ||
do jq -n --arg tag "$tag" '{ref: "master", inputs: {commitish: $tag}}' | \ | ||
curl -fsSL -X POST -d@- \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
https://api.github.com/repos/datalad/git-annex/actions/workflows/"$workflow"/dispatches | ||
done | ||
done < new-tags.txt | ||
|
||
# vim:set sts=2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool -- didn't know about
comm
, nice