-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b028be
commit e2df8b3
Showing
4 changed files
with
117 additions
and
4 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,56 @@ | ||
name: Automatic Update (2024 Pre) | ||
|
||
on: | ||
push: | ||
branches: master | ||
schedule: | ||
- cron: "0 */2 * * *" | ||
|
||
jobs: | ||
setup-build-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get latest release tag | ||
id: get_latest_release_tag | ||
run: | | ||
LATEST=$(curl -s https://api.github.com/repos/tModLoader/tModLoader/releases | jq -r "[.[] | select(.tag_name | contains(\"2024\")) | select(.prerelease == true)] | max_by(.created_at) | .tag_name | sub(\"^v\";\"\")") | ||
echo "Latest 2024 pre-release is ${LATEST}" | ||
echo "latest_tag=$LATEST" >> "$GITHUB_OUTPUT" | ||
- name: Check if version already exists | ||
run: | | ||
CHECK=$(curl -s "https://hub.docker.com/v2/repositories/passivelemon/tmodloader1.4-docker/tags/${{ steps.get_latest_release_tag.outputs.latest_tag }}") | ||
echo $CHECK | ||
if echo "${CHECK}" | jq -e ".digest" > /dev/null; then | ||
echo "Version ${{ steps.get_latest_release_tag.outputs.latest_tag }} already exists. Stopping..." | ||
exit 1 | ||
fi | ||
echo "Version ${{ steps.get_latest_release_tag.outputs.latest_tag }} does not already exist. Continuing..." | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker & GHCR | ||
run: | | ||
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | ||
echo "${{ secrets.GHCR_PASSWORD }}" | docker login ghcr.io -u "${{ secrets.GHCR_USERNAME }}" --password-stdin | ||
- name: Build the image | ||
run: | | ||
docker buildx create --name mainbuilder --driver docker-container --platform linux/amd64 --use | ||
docker buildx build --push \ | ||
--build-arg VERSION=${{ steps.get_latest_release_tag.outputs.latest_tag }} \ | ||
--provenance=false \ | ||
--platform linux/amd64 \ | ||
--tag ${{ secrets.DOCKER_USERNAME }}/tmodloader1.4-docker:${{ steps.get_latest_release_tag.outputs.latest_tag }} \ | ||
--tag ${{ secrets.DOCKER_USERNAME }}/tmodloader1.4-docker:latest-2024-pre \ | ||
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/tmodloader1.4-docker:${{ steps.get_latest_release_tag.outputs.latest_tag }} \ | ||
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/tmodloader1.4-docker:latest-2024-pre \ | ||
. |
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,59 @@ | ||
name: Automatic Update (2024) | ||
|
||
on: | ||
push: | ||
branches: master | ||
schedule: | ||
- cron: "0 */5 * * *" | ||
|
||
jobs: | ||
setup-build-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- uses: gautamkrishnar/keepalive-workflow@v1 | ||
|
||
- name: Get latest release tag | ||
id: get_latest_release_tag | ||
run: | | ||
LATEST=$(curl -s https://api.github.com/repos/tModLoader/tModLoader/releases | jq -r "[.[] | select(.tag_name | contains(\"2024\")) | select(.prerelease == false)] | max_by(.created_at) | .tag_name | sub(\"^v\";\"\")") | ||
echo "Latest 2024 release is ${LATEST}" | ||
echo "latest_tag=$LATEST" >> "$GITHUB_OUTPUT" | ||
- name: Check if version already exists | ||
run: | | ||
CHECK=$(curl -s "https://hub.docker.com/v2/repositories/passivelemon/tmodloader1.4-docker/tags/${{ steps.get_latest_release_tag.outputs.latest_tag }}") | ||
echo $CHECK | ||
if echo "${CHECK}" | jq -e ".digest" > /dev/null; then | ||
echo "Version ${{ steps.get_latest_release_tag.outputs.latest_tag }} already exists. Stopping..." | ||
exit 1 | ||
fi | ||
echo "Version ${{ steps.get_latest_release_tag.outputs.latest_tag }} does not already exist. Continuing..." | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker & GHCR | ||
run: | | ||
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | ||
echo "${{ secrets.GHCR_PASSWORD }}" | docker login ghcr.io -u "${{ secrets.GHCR_USERNAME }}" --password-stdin | ||
- name: Build the image | ||
run: | | ||
docker buildx create --name mainbuilder --driver docker-container --platform linux/amd64 --use | ||
docker buildx build --push \ | ||
--build-arg VERSION=${{ steps.get_latest_release_tag.outputs.latest_tag }} \ | ||
--provenance=false \ | ||
--platform linux/amd64 \ | ||
--tag ${{ secrets.DOCKER_USERNAME }}/tmodloader1.4-docker:${{ steps.get_latest_release_tag.outputs.latest_tag }} \ | ||
--tag ${{ secrets.DOCKER_USERNAME }}/tmodloader1.4-docker:latest-2024 \ | ||
--tag ${{ secrets.DOCKER_USERNAME }}/tmodloader1.4-docker:latest \ | ||
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/tmodloader1.4-docker:${{ steps.get_latest_release_tag.outputs.latest_tag }} \ | ||
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/tmodloader1.4-docker:latest-2024 \ | ||
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/tmodloader1.4-docker:latest \ | ||
. |
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