This repository has been archived by the owner on Oct 25, 2022. It is now read-only.
forked from cameroncondry/cbc-kitten-scientists
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3e79e1
commit a8b5527
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Publish Userscript Nightly | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
# Allows you to run this workflow manually from the Actions tab. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check_date: | ||
runs-on: ubuntu-latest | ||
name: Check latest commit | ||
outputs: | ||
should_run: ${{ steps.should_run.outputs.should_run }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: print latest_commit | ||
run: echo ${{ github.sha }} | ||
|
||
- id: should_run | ||
continue-on-error: true | ||
name: check latest commit is less than a day | ||
if: ${{ github.event_name == 'schedule' }} | ||
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" | ||
|
||
nightly: | ||
needs: check_date | ||
if: ${{ needs.check_date.outputs.should_run != 'false' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: "Use Node.js 18.x" | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build userscript | ||
run: yarn userscript:release | ||
|
||
- name: Release nightly | ||
uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "nightly" | ||
prerelease: true | ||
title: "Nightly Build" | ||
files: | | ||
packages/userscript/bundle/* |