diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index dc78275..d3dc928 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -4,6 +4,31 @@ on: push: tags: - 'v*.*.*' + workflow_dispatch: + inputs: + build-target: + description: 'Build Target (Release Type)' + type: choice + required: true + options: + - nightly + default: "nightly" + git-ref: + description: "Release Git Ref (Which branch or tag to build?)" + required: true + default: "master" + is-draft: + description: 'Draft Release? (Beta only, Nightly will always be a non-draft)' + type: boolean + required: true + default: true + is-pre-release: + description: 'Pre Release? (labeled as "PreRelease")' + type: boolean + required: true + default: true + schedule: + - cron: "0 10 * * *" jobs: build-docker-image: @@ -46,6 +71,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push + if: ${{ github.event_name == 'push' }} uses: docker/build-push-action@v5 with: context: . @@ -54,3 +80,27 @@ jobs: tags: | dawsh/marzneshin:latest dawsh/marzneshin:${{github.ref_name}} + + - name: Nightly build and push for docker + if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly'}} + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + dawsh/marzneshin:nightly + + - name: Update Nightly Release + if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly'}} + uses: andelf/nightly-release@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: nightly + name: 'Marzneshin nightly release $$' + prerelease: true + draft: false + body: | + This is a nightly release of Marzneshin. + It's unstable compared to the official releases, **use it with caution**!