Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
ci: Add nightly build
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Apr 29, 2022
1 parent c3e79e1 commit a8b5527
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/userscript-nightly.yml
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/*

0 comments on commit a8b5527

Please sign in to comment.