From 8148dc692c5f5f943f0468b5500e59bf6a5fa3a3 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Mon, 26 Feb 2024 16:26:36 +0600 Subject: [PATCH] Add nightly builds --- .github/workflows/build-packages.yml | 8 ++++--- .github/workflows/release.yml | 35 +++++++++++++++++++--------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index 4e6950f2f1..cb938b7c04 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -6,6 +6,8 @@ on: branches: [master] tags: - '*' + schedule: + - cron: '0 2 * * *' env: GITHUB_OWNER: mysteriumnetwork @@ -33,10 +35,10 @@ jobs: - name: Prepare environment run: | RELEASE_BUILD=false - if [[ "${GITHUB_REF}" == /refs/tags/* ]]; then RELEASE_BUILD=true; fi + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then RELEASE_BUILD=true; fi RC_BUILD=false - if [[ "${GITHUB_REF}" == /refs/tags/*-rc* ]]; then RC_BUILD=true; fi + if [[ "${GITHUB_REF}" == refs/tags/*-rc* ]]; then RC_BUILD=true; fi SNAPSHOT_BUILD=false if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then SNAPSHOT_BUILD=true; fi @@ -45,7 +47,7 @@ jobs: if [[ "${SNAPSHOT_BUILD}" == "false" && "${RELEASE_BUILD}" == "false" ]]; then PR_BUILD=true; fi if [[ "${RELEASE_BUILD}" == "true" ]]; then - BUILD_VERSION="${GITHUB_REF#/refs/tags/}"; + BUILD_VERSION="${GITHUB_REF#refs/tags/}"; elif [[ "${SNAPSHOT_BUILD}" == "true" ]]; then BUILD_VERSION="$(git describe --abbrev=0 --tags)"-1snapshot-"$(date '+%Y%m%dT%H%M')"-"$(echo ${GITHUB_SHA} | cut -c1-8)"; elif [[ "${PR_BUILD}" == "true" ]]; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45b8718ea0..e5b01b6026 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,29 @@ env: AWS_EC2_METADATA_DISABLED: true jobs: + release-nightly: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'schedule' }} + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.21.x' + - uses: actions/download-artifact@v4 + with: + name: env.sh + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Release nightly snapshot + run: | + source env.sh + go run mage.go -v ReleaseGithubNightly + + - name: Notify UptimeRobot + run: curl -so /dev/null -I "${{ secrets.NIGHTLY_UPTIMEROBOT }}" + release-snapshot: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' @@ -21,8 +44,6 @@ jobs: matrix: platform: - ReleaseGithubSnapshot - # Nightly build - # - ReleaseGithubNightly - ReleaseDockerSnapshot - ReleaseDebianPPASnapshot @@ -110,8 +131,7 @@ jobs: post-release: runs-on: ubuntu-latest - needs: [release-snapshot, release-tag] - if: always() && contains(join(needs.*.result, ','), 'success') + needs: [release-tag] steps: - uses: actions/checkout@v4 @@ -124,14 +144,7 @@ jobs: name: env.sh github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Notify UptimeRobot - if: github.ref == 'refs/heads/master' - run: | - if [ "$NIGHTLY_BUILD" = "1" -o "$NIGHTLY_BUILD" = "T" -o "$NIGHTLY_BUILD" = "true" -o "$NIGHTLY_BUILD" = "True" -o "$NIGHTLY_BUILD" = "TRUE" ]; then - curl -so /dev/null -I "$NIGHTLY_UPTIMEROBOT" - fi - name: PR Avado run: | source env.sh go run mage.go -v CreateAvadoPR -