diff --git a/.forgejo/workflows/package-check.yml b/.forgejo/workflows/package-check.yml index f9ab570..20d1e12 100644 --- a/.forgejo/workflows/package-check.yml +++ b/.forgejo/workflows/package-check.yml @@ -1,5 +1,5 @@ -name: Auto Build p2pool Node Docker Container -enable-email-notifications: true +name: Auto Build Monero Node Docker Container + on: workflow_dispatch: @@ -11,34 +11,26 @@ jobs: runs-on: dind env: - PACKAGE: p2pool + PACKAGE: monero DOCKER_REGISTRY: git.shork.ch REGISTRY_USER: melody COMMIT_AUTHOR_NAME: "forgejo-runner" COMMIT_AUTHOR_EMAIL: "forgejo-runner@shork.ch" COMMIT_MESSAGE: "Update build metadata" - GET_NEWEST_VERSION_CMD: "curl https://api.github.com/repos/SChernykh/p2pool/tags | jq -r .[0].name" - GIT_REPO_URL: "https://github.com/SChernykh/p2pool" steps: - name: Install dependencies shell: sh run: | - echo "Run because of ${{ github.event_name }}" - apk add --no-cache git nodejs npm bash sed curl jq + apk add --no-cache git bash jq nodejs npm curl - uses: actions/checkout@v3 - name: Get latest package version id: check run: | - newest_version=$(eval "$GET_NEWEST_VERSION_CMD") + newest_version=$(curl https://api.github.com/repos/monero-project/monero/tags | jq -r .[0].name) echo "NEWEST_VERSION=$newest_version" >> $GITHUB_ENV - echo "Newest version: $newest_version" - echo "Current version: $(cat .last_version)" - echo "Today number: $(( $(date +%s) / 86400 ))" - echo "Current number: $(cat .last_rebuild)" - - name: Determine if update is needed run: | @@ -51,7 +43,7 @@ jobs: current_day=$(( $(date +%s) / 86400 )) update="false" - if [ ${{ github.event_name }} == "workflow_dispatch" ] || [ "$last_version" != "$NEWEST_VERSION" ] || [ $((current_day - last_rebuild)) -gt 14 ]; then + if [ "$last_version" != "$NEWEST_VERSION" ] || [ $((current_day - last_rebuild)) -gt 14 ]; then update="true" fi @@ -72,13 +64,14 @@ jobs: - name: Build and push Docker image if: env.UPDATE == 'true' run: | - git clone $GIT_REPO_URL ../$PACKAGE - cd ../$PACKAGE + git clone https://github.com/monero-project/monero ../monero + cd ../monero git fetch --all --tags git checkout tags/$NEWEST_VERSION docker build --build-arg NPROC=1 -t $DOCKER_REGISTRY/$REGISTRY_USER/docker-$PACKAGE:latest -t $DOCKER_REGISTRY/$REGISTRY_USER/docker-$PACKAGE:$NEWEST_VERSION . echo "${{ secrets.DOCKER_PASSWORD }}" | docker login $DOCKER_REGISTRY -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin docker push $DOCKER_REGISTRY/$REGISTRY_USER/docker-$PACKAGE:latest + cd - name: Commit updated metadata if: env.UPDATE == 'true' @@ -88,5 +81,5 @@ jobs: git config user.name "$COMMIT_AUTHOR_NAME" git config user.email "$COMMIT_AUTHOR_EMAIL" git add .last_version .last_rebuild - git commit -m "$COMMIT_MESSAGE" || echo "No commit" + git commit -m "$COMMIT_MESSAGE" git push \ No newline at end of file diff --git a/.last_rebuild b/.last_rebuild index 4146d1b..3d01164 100644 --- a/.last_rebuild +++ b/.last_rebuild @@ -1 +1 @@ -20294 +20290 diff --git a/.last_version b/.last_version index 9ce29ad..00aee84 100644 --- a/.last_version +++ b/.last_version @@ -1 +1 @@ -v4.9 +v0.18.4.1