Skip to content

Commit

Permalink
Merge pull request #70 from AntonOks/master
Browse files Browse the repository at this point in the history
update_release.yml: Add initial release
  • Loading branch information
AntonOks authored Oct 3, 2024
2 parents c441dda + e0c005d commit 741f52d
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/update_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Keep the Rakudo-Star release and it's docker image in sync

name: Synchronize Docker image with the Rakudo-Star release

on:
schedule: # 1 hour after https://github.com/rakudo/star/tree/master/.github/workflows/publish_rakudo-star_on_rakudo.org.yml
- cron: '55 2 * * 1,4'
workflow_dispatch:

jobs:
update_docker_image:
runs-on: ubuntu-latest
steps:

- name: Get Rakudo-Star version from Rakudo.org
id: rkd_v_check
run: |
RKD_VERSION_TMP=$(curl -s https://rakudo.org/dl/star/ | jq -r '.[] | select((.latest==1) and (.url|test("-win-x86_64-")) and (.url|test("checksum|asc")|not)) | .url')
if [[ "$RKD_VERSION_TMP" =~ rakudo-star-([0-9]+.[0-9]+.?[0-9]?)-([0-9]+)- ]]; then
RKD_VERSION="${BASH_REMATCH[1]}"
RKD_REVISION="${BASH_REMATCH[2]}"
echo "RKD_VERSION=$RKD_VERSION" >> "$GITHUB_OUTPUT"
echo "RKD_REVISION=$RKD_REVISION" >> "$GITHUB_OUTPUT"
else
echo "Couldn't resolve the RAKUDO.ORG Star version"
exit
fi
- name: Checkout repository
if: ${{ steps.rkd_v_check.outputs.RKD_VERSION }}
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Compare RAKUDO.ORG release with this Docker repo
if: ${{ steps.rkd_v_check.outputs.RKD_VERSION }}
run: |
echo "run the \"Compare...\""
ls -lad [0-9]*
grep -i "rakudo_version=" */*/Dockerfile
- name: Update release directory and Docker files
if: ${{ steps.rkd_v_check.outputs.RKD_VERSION }}
run: |
echo "run the \"Compare...\""
LOC_DIR=$(ls -1 */*/Dockerfile | cut -d "/" -f1 | sort -u)
echo "\"LOC_DIR\" is \"$LOC_DIR\""
if [[ "$LOC_DIR" != "${{ steps.rkd_v_check.outputs.RKD_VERSION }}" ]]; then
git mv --verbose --force "$LOC_DIR" "${{ steps.rkd_v_check.outputs.RKD_VERSION }}"
sed -i -r s#rakudo_version\=\([0-9]\)\.+\$#rakudo_version=${{ steps.rkd_v_check.outputs.RKD_VERSION }}-${{ steps.rkd_v_check.outputs.RKD_REVISION }}# ${{ steps.rkd_v_check.outputs.RKD_VERSION }}/*/Dockerfile
fi
- name: List this Docker repo after changes
if: ${{ steps.rkd_v_check.outputs.RKD_VERSION }}
run: |
echo "run the \"Compare...\""
ls -lad ${{ steps.rkd_v_check.outputs.RKD_VERSION }}
grep -i "rakudo_version=" */*/Dockerfile
- name: Commit and push changes
if: ${{ steps.rkd_v_check.outputs.RKD_VERSION }}
uses: EndBug/add-and-commit@v9
with:
message: "Bump to ${{ steps.rkd_v_check.outputs.RKD_VERSION }} [skip workflow]"
tag: "${{ steps.rkd_v_check.outputs.RKD_VERSION }}"
push: "true"
tag_push: '--force'

0 comments on commit 741f52d

Please sign in to comment.