Skip to content

Commit

Permalink
[no ci] allow building draft / release via dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX authored Oct 23, 2024
1 parent 3ab9154 commit 5a73093
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ on:
- main
pull_request:
workflow_dispatch:
inputs:
type:
type: choice
default: draft
options:
- build
- draft
- release
jobs:
ci:
uses: ./.github/workflows/main.yml
Expand All @@ -13,4 +21,5 @@ jobs:
use-repo-files: true
offset: 400
build-m1: true
draft: ${{ github.event_name == 'workflow_dispatch' && inputs.type == 'draft' }}
secrets: inherit
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ on:
publish:
type: boolean
default: false
draft:
type: boolean
default: false
offset:
type: number
default: 0
Expand Down Expand Up @@ -808,10 +811,10 @@ jobs:
run: |
curl -L https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_darwin_amd64.zip --output ghr.zip
unzip ghr.zip
- name: Upload ${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[DRAFT]') && 'Latest' || 'Draft' }}
- name: Upload ${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[DRAFT]' && !inputs.draft) && 'Latest' || 'Draft' }}
if: steps.files-updated.result != 'skipped'
run: |
./ghr*/ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${{ steps.setup-vars.outputs.owner }} -r ${{ steps.setup-vars.outputs.repo }} ${{ !(github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[DRAFT]')) && '-draft ' || '' }}-b "$LAUNCHER_RELEASE_DESCRIPTION$(cat changelog.txt)" "$(cat version.txt)-${{ steps.setup-vars.outputs.build-number }}" dist2/
./ghr*/ghr -c ${{ github.sha }} -t ${{ secrets.GITHUB_TOKEN }} -u ${{ steps.setup-vars.outputs.owner }} -r ${{ steps.setup-vars.outputs.repo }} ${{ !(github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[DRAFT]') && !inputs.draft) && '-draft ' || '' }}-b "$LAUNCHER_RELEASE_DESCRIPTION$(cat changelog.txt)" "$(cat version.txt)-${{ steps.setup-vars.outputs.build-number }}" dist2/
env:
LAUNCHER_RELEASE_DESCRIPTION: |
Links for linux flatpak or AppImage can be found on our wiki https://minecraft-linux.github.io.
Expand Down Expand Up @@ -862,6 +865,6 @@ jobs:
### Changelog
- name: Publish release
if: steps.files-updated.result != 'skipped' && !contains(github.event.head_commit.message, '[DRAFT]')
if: steps.files-updated.result != 'skipped' && !contains(github.event.head_commit.message, '[DRAFT]') && !inputs.draft
run: |
./ghr*/ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${{ steps.setup-vars.outputs.owner }} -r ${{ steps.setup-vars.outputs.repo }} -replace ng.dmg dist/

0 comments on commit 5a73093

Please sign in to comment.