98 lines
2.6 KiB
YAML
98 lines
2.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
workflow_dispatch: {}
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: [self-hosted, roku]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: "npm"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: npm run test
|
|
|
|
- name: Build Playlet for release
|
|
run: npm run build:release
|
|
|
|
- name: Upload release
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release
|
|
path: |
|
|
release/playlet.zip
|
|
release/playlet.squashfs.pkg
|
|
release/playlet-lib.zip
|
|
release/playlet-lib.squashfs.pkg
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
publish:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download release
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: release
|
|
path: release
|
|
|
|
- name: Use Java 25
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "25"
|
|
|
|
- name: Download the Static Channel Analysis CLI
|
|
run: |
|
|
curl -sSL "https://devtools.web.roku.com/static-channel-analysis/sca-cmd.zip" -o sca-cmd.zip
|
|
unzip sca-cmd.zip
|
|
|
|
- name: Run Analysis on Playlet Lib
|
|
run: ./sca-cmd/bin/sca-cmd ./release/playlet-lib.zip --exit error
|
|
|
|
- name: Run Analysis on Playlet App
|
|
run: ./sca-cmd/bin/sca-cmd ./release/playlet.zip --exit error
|
|
|
|
- name: Delete Canary release
|
|
uses: dev-drprasad/delete-tag-and-release@v1.0
|
|
with:
|
|
tag_name: canary
|
|
github_token: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Extract changelog
|
|
run: |
|
|
latest_release=$(awk 'BEGIN { RS="## \\[" } NR==2 { print "## ["$0 }' CHANGELOG.md)
|
|
echo -e "\n$latest_release" >> docs/canary-changelog.md
|
|
|
|
# A bug in gh cli causes the release to be created as a draft, and not released.
|
|
# See https://github.com/cli/cli/issues/8458
|
|
- name: Wait 10 seconds
|
|
run: sleep 10
|
|
|
|
- name: Create Canary release
|
|
run: gh release create canary ./release/playlet.zip ./release/playlet.squashfs.pkg ./release/playlet-lib.zip ./release/playlet-lib.squashfs.pkg --notes-file docs/canary-changelog.md --prerelease --title Canary
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|