ci: add automatic nightly builds to the Github Actions workflow (#1397)

Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
Konrad Baran 2024-08-07 01:58:04 +02:00 committed by sxyazi
parent 52681b19e4
commit f865910481
No known key found for this signature in database
2 changed files with 33 additions and 2 deletions

View File

@ -1,8 +1,8 @@
name: Cachix
on:
push:
branches:
- main
branches: [main]
jobs:
publish:

View File

@ -4,6 +4,9 @@ on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
build-unix:
@ -145,3 +148,31 @@ jobs:
yazi-*.zip
yazi-*.snap
generate_release_notes: true
nightly:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build-unix, build-windows, build-musl, build-snap]
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- run: |
echo 'NIGHTLY_BODY<<EOF' >> $GITHUB_ENV
echo "From commit: ${GITHUB_SHA:0:8}" >> $GITHUB_ENV
echo "Generated on: $(date -u +"%Y-%m-%d %H:%M") UTC" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Nightly
uses: softprops/action-gh-release@v1
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
with:
tag_name: nightly
prerelease: true
files: |
yazi-*.zip
yazi-*.snap
name: Nightly Build
body: ${{ env.NIGHTLY_BODY }}