-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from nicholasphair/feat/sphinx-synch-tooling
add devs synch tooling without commit history
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Daily check for new Sphinx dockers to build against. | ||
|
||
on: | ||
schedule: | ||
# Runs at midnight UTC every day. | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-shell-script: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run a shell script | ||
run: | | ||
./bin/tryrelease | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
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,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
DOCKERFILE="Dockerfile" | ||
: ${RUNNER_TEMP:=/tmp} | ||
|
||
|
||
fetch_current_tags() { | ||
gh api repos/:owner/:repo/git/refs/tags \ | ||
--jq '.[]' -q '.[] | .ref' | | ||
cut -d'/' -f3 | | ||
sort | ||
} | ||
|
||
fetch_sphinx_image_tags() { | ||
gh api repos/sphinx-doc/sphinx-docker-images/git/refs/tags \ | ||
--jq '.[]' -q '.[] | .ref' | | ||
cut -d'/' -f3 | | ||
sort | ||
} | ||
|
||
NEW_TAGS="${RUNNER_TEMP}/new_tags.txt" | ||
comm -13 <(fetch_current_tags) <(fetch_sphinx_image_tags) > "$NEW_TAGS" | ||
if [ ! -s "$NEW_TAGS" ]; then | ||
echo "No new tags found." | ||
exit 0 | ||
fi | ||
|
||
while IFS= read -r tag; do | ||
sed -i "1s#.*#FROM sphinxdoc/sphinx:${tag}#g" "$DOCKERFILE" | ||
|
||
git add "$DOCKERFILE" | ||
git commit --message "build(release): release version ${tag}" | ||
git tag "$tag" | ||
git push --tags | ||
done < "$NEW_TAGS" | ||
|
||
rm "$NEW_TAGS" | ||
|