From f8659104814f183a1f580bd30cb481136105bf94 Mon Sep 17 00:00:00 2001 From: Konrad Baran <65494005+uznog@users.noreply.github.com> Date: Wed, 7 Aug 2024 01:58:04 +0200 Subject: [PATCH] ci: add automatic nightly builds to the Github Actions workflow (#1397) Co-authored-by: sxyazi --- .github/workflows/cachix.yml | 4 ++-- .github/workflows/draft.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 0f9e8db31..ade1e1625 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -1,8 +1,8 @@ name: Cachix + on: push: - branches: - - main + branches: [main] jobs: publish: diff --git a/.github/workflows/draft.yml b/.github/workflows/draft.yml index e15aa1fcc..f8a3d8b46 100644 --- a/.github/workflows/draft.yml +++ b/.github/workflows/draft.yml @@ -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<> $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 }}