Skip to content

Activate Nightly Build #632

Activate Nightly Build

Activate Nightly Build #632

name: Activate Nightly Build
on:
workflow_dispatch:
schedule:
- cron: "0 23 * * *"
jobs:
publish_binary_packages:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: set nightly version
id: nightly
continue-on-error: false
if: ${{ github.event_name }} == 'schedule' || ${{ github.event.inputs.nightly }} == 'true'
run: |
VERSION=`curl "https://api.github.com/repos/cli/cli/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-`
echo $VERSION
curl -sSL https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz -o gh_${VERSION}_linux_amd64.tar.gz
tar xvf gh_${VERSION}_linux_amd64.tar.gz
sudo cp gh_${VERSION}_linux_amd64/bin/gh /usr/local/bin/
gh version
echo "${{ secrets.MOWORKFLOWTOKEN }}" | gh auth login --with-token
BASE_VERSION=$(cat charts/gluu/Chart.yaml | grep "appVersion" | awk -F ": " '{print $2}' | tr -d '"' | sed 's/-dev//')
# Clean up old nightly release
gh release delete v${BASE_VERSION}.nightly --cleanup-tag --yes || echo "v${BASE_VERSION}.nightly" does not exist
git push --delete origin v${BASE_VERSION}.nightly || echo "v${BASE_VERSION}.nightly" does not exist
# Create new nightly release
gh release delete v${BASE_VERSION}.nightly --cleanup-tag --yes || echo "v${BASE_VERSION}.nightly" does not exist
gh release delete v${BASE_VERSION}.nightly --cleanup-tag --yes || echo "v${BASE_VERSION}.nightly" does not exist
git push --delete origin v${BASE_VERSION}.nightly || echo "v${BASE_VERSION}.nightly" does not exist
gh release create v${BASE_VERSION}.nightly --generate-notes --prerelease --title "v${BASE_VERSION}.nightly"