Skip to content

Commit

Permalink
Add test action that creates nightly release
Browse files Browse the repository at this point in the history
  • Loading branch information
jedekar committed Nov 20, 2023
1 parent 1572427 commit 4e09605
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/github-nightly.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 4e09605

Please sign in to comment.