From 4e09605b33b763602007ebafa38dd124ba90b5bb Mon Sep 17 00:00:00 2001 From: Oleksandr Khodos Date: Mon, 20 Nov 2023 15:08:38 +0200 Subject: [PATCH] Add test action that creates nightly release --- .github/workflows/github-nightly.yaml | 81 +++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/github-nightly.yaml diff --git a/.github/workflows/github-nightly.yaml b/.github/workflows/github-nightly.yaml new file mode 100644 index 00000000000..6203f159b18 --- /dev/null +++ b/.github/workflows/github-nightly.yaml @@ -0,0 +1,81 @@ +# Copyright 2023 Pluto TV +# Copyright 2022 Google LLC +# +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file or at +# https://developers.google.com/open-source/licenses/bsd + +name: GitHub Nightly Build + +on: + workflow_dispatch: + +jobs: + setup: + name: Setup + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.compute_tag.outputs.tag }} + steps: + - name: Checkout development branch + uses: actions/checkout@v2 + with: + ref: 'pluto-cmake' + - name: Create tag + uses: actions/github-script@v5 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/nightly', + sha: context.sha + }) + - name: Compute tag + id: compute_tag + run: | + # Strip refs/tags/ from the input to get the tag name, then store + # that in output. + echo "::set-output name=tag::nightly" + + draft_release: + name: Create GitHub release + needs: setup + runs-on: ubuntu-latest + outputs: + release_id: ${{ steps.draft_release.outputs.id }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ needs.setup.outputs.tag }} + + - name: Extract release notes + run: | + packager/tools/extract_from_changelog.py --release_notes \ + | tee ../RELEASE_NOTES.md + + - name: Draft release + id: draft_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.BUILD_TOKEN_EPHEMERAL}} + with: + tag_name: ${{ needs.setup.outputs.tag }} + release_name: ${{ needs.setup.outputs.tag }} + body_path: RELEASE_NOTES.md + draft: true + + lint: + needs: setup + name: Lint + uses: ./.github/workflows/lint.yaml + with: + ref: ${{ needs.setup.outputs.tag }} + + build_and_test: + needs: [setup, lint, draft_release] + name: Build and test + uses: ./.github/workflows/build.yaml + with: + ref: ${{ needs.setup.outputs.tag }}