mirror of
https://github.com/nushell/nushell.git
synced 2025-02-23 05:51:28 +01: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
13
.github/workflows/nightly-build.yml
vendored
13
.github/workflows/nightly-build.yml
vendored
@ -12,7 +12,7 @@ on:
|
|||||||
# branches:
|
# branches:
|
||||||
# - main
|
# - main
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 3 * * *' # run at 3 AM UTC
|
- cron: '15 3 * * *' # run at 3:15 AM UTC
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@ -21,11 +21,11 @@ defaults:
|
|||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
name: Prepare
|
name: Prepare
|
||||||
if: github.repository == 'nushell/nightly'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
if: github.repository == 'nushell/nightly'
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@ -34,6 +34,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Nushell
|
- name: Setup Nushell
|
||||||
uses: hustcer/setup-nu@v3
|
uses: hustcer/setup-nu@v3
|
||||||
|
if: github.repository == 'nushell/nightly'
|
||||||
with:
|
with:
|
||||||
version: 0.81.0
|
version: 0.81.0
|
||||||
env:
|
env:
|
||||||
@ -41,6 +42,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Prepare for Nightly Release
|
- name: Prepare for Nightly Release
|
||||||
shell: nu {0}
|
shell: nu {0}
|
||||||
|
if: github.repository == 'nushell/nightly'
|
||||||
run: |
|
run: |
|
||||||
cd $env.GITHUB_WORKSPACE
|
cd $env.GITHUB_WORKSPACE
|
||||||
git checkout main
|
git checkout main
|
||||||
@ -182,12 +184,14 @@ jobs:
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
name: Cleanup
|
name: Cleanup
|
||||||
needs: release
|
|
||||||
if: github.repository == 'nushell/nightly'
|
if: github.repository == 'nushell/nightly'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
# Sleep for 30 minutes, waiting for the release to be published
|
||||||
|
- name: Waiting for Release
|
||||||
|
run: sleep 1800
|
||||||
|
|
||||||
- name: Setup Nushell
|
- name: Setup Nushell
|
||||||
if: ${{ always() }} # Always evaluates to true
|
|
||||||
uses: hustcer/setup-nu@v3
|
uses: hustcer/setup-nu@v3
|
||||||
with:
|
with:
|
||||||
version: 0.81.0
|
version: 0.81.0
|
||||||
@ -198,7 +202,6 @@ jobs:
|
|||||||
# Should only run in nushell/nightly repo
|
# Should only run in nushell/nightly repo
|
||||||
- name: Delete Older Releases
|
- name: Delete Older Releases
|
||||||
shell: nu {0}
|
shell: nu {0}
|
||||||
if: ${{ always() }} # Always evaluates to true
|
|
||||||
run: |
|
run: |
|
||||||
let KEEP_COUNT = 10
|
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..)
|
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 New Issue
Block a user