Activate Nightly Build #1132
This file contains hidden or 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
| name: Activate Nightly Build | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch: | ||
| description: 'The branch to build night release from' | ||
| required: false | ||
| default: 'main' | ||
| schedule: | ||
| - cron: "0 23 * * *" | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| publish_binary_packages: | ||
| permissions: | ||
| contents: write # for Git to git push | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 | ||
| with: | ||
| egress-policy: audit | ||
| - name: Checkout | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - name: set nightly version | ||
| id: nightly | ||
| continue-on-error: false | ||
| if: ${{ github.event_name }} == 'schedule' || ${{ github.event.inputs.nightly }} == 'true' | ||
|
Check warning on line 32 in .github/workflows/activate-nightly-build.yml
|
||
| 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 | ||
| NIGHTLY_VERSION="nightly" | ||
| gh release delete ${NIGHTLY_VERSION} --cleanup-tag --yes || echo "${NIGHTLY_VERSION}" does not exist | ||
| gh release delete ${NIGHTLY_VERSION} --cleanup-tag --yes || echo "${NIGHTLY_VERSION}" does not exist | ||
| git push --delete origin ${NIGHTLY_VERSION} || echo "${NIGHTLY_VERSION}" does not exist | ||
| TARGET_BRANCH=${{ github.event.inputs.branch }} | ||
| if [ -z "$TARGET_BRANCH" ]; then | ||
| TARGET_BRANCH="main" | ||
| fi | ||
| gh release create ${NIGHTLY_VERSION} --generate-notes --prerelease --title "${NIGHTLY_VERSION}" --target "${TARGET_BRANCH}" | ||