mirror of
https://github.com/nushell/nushell
synced 2025-01-13 05:38:57 +00:00
Fix cleanup of nightly build workflow (#9441)
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description Fix cleanup of nightly build workflow
This commit is contained in:
parent
b5d43f1e20
commit
b907bf355f
1 changed files with 8 additions and 5 deletions
13
.github/workflows/nightly-build.yml
vendored
13
.github/workflows/nightly-build.yml
vendored
|
@ -12,7 +12,7 @@ on:
|
|||
# branches:
|
||||
# - main
|
||||
schedule:
|
||||
- cron: '0 3 * * *' # run at 3 AM UTC
|
||||
- cron: '15 3 * * *' # run at 3:15 AM UTC
|
||||
|
||||
defaults:
|
||||
run:
|
||||
|
@ -21,11 +21,11 @@ defaults:
|
|||
jobs:
|
||||
prepare:
|
||||
name: Prepare
|
||||
if: github.repository == 'nushell/nightly'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
if: github.repository == 'nushell/nightly'
|
||||
with:
|
||||
ref: main
|
||||
fetch-depth: 0
|
||||
|
@ -34,6 +34,7 @@ jobs:
|
|||
|
||||
- name: Setup Nushell
|
||||
uses: hustcer/setup-nu@v3
|
||||
if: github.repository == 'nushell/nightly'
|
||||
with:
|
||||
version: 0.81.0
|
||||
env:
|
||||
|
@ -41,6 +42,7 @@ jobs:
|
|||
|
||||
- name: Prepare for Nightly Release
|
||||
shell: nu {0}
|
||||
if: github.repository == 'nushell/nightly'
|
||||
run: |
|
||||
cd $env.GITHUB_WORKSPACE
|
||||
git checkout main
|
||||
|
@ -182,12 +184,14 @@ jobs:
|
|||
|
||||
cleanup:
|
||||
name: Cleanup
|
||||
needs: release
|
||||
if: github.repository == 'nushell/nightly'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Sleep for 30 minutes, waiting for the release to be published
|
||||
- name: Waiting for Release
|
||||
run: sleep 1800
|
||||
|
||||
- name: Setup Nushell
|
||||
if: ${{ always() }} # Always evaluates to true
|
||||
uses: hustcer/setup-nu@v3
|
||||
with:
|
||||
version: 0.81.0
|
||||
|
@ -198,7 +202,6 @@ jobs:
|
|||
# Should only run in nushell/nightly repo
|
||||
- name: Delete Older Releases
|
||||
shell: nu {0}
|
||||
if: ${{ always() }} # Always evaluates to true
|
||||
run: |
|
||||
let KEEP_COUNT = 10
|
||||
let deprecated = (http get https://api.github.com/repos/nushell/nightly/releases | sort-by -r created_at | select tag_name id | range $KEEP_COUNT..)
|
||||
|
|
Loading…
Reference in a new issue