Skip to content

Commit

Permalink
Add nightly builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tzununbekov committed Feb 26, 2024
1 parent bb117b2 commit 8148dc6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches: [master]
tags:
- '*'
schedule:
- cron: '0 2 * * *'

env:
GITHUB_OWNER: mysteriumnetwork
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
35 changes: 24 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -21,8 +44,6 @@ jobs:
matrix:
platform:
- ReleaseGithubSnapshot
# Nightly build
# - ReleaseGithubNightly
- ReleaseDockerSnapshot
- ReleaseDebianPPASnapshot

Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 8148dc6

Please sign in to comment.