-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
108 lines (98 loc) · 3.13 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: 'Create Playdate Release'
description: 'Compiles a Playdate project and attaches it to a release'
branding:
color: yellow
icon: paperclip
inputs:
github_token:
description: 'You need to pass your GITHUB_TOKEN to the action'
required: true
# pdc options
input:
description: 'The source directory of the project'
default: 'source'
required: false
output:
description: 'The name of the build target directory'
default: 'build'
required: false
compress:
description: 'Compress output files'
default: 'true'
required: false
quiet:
description: 'Quiet mode, suppresses non-error output'
default: 'false'
required: false
strip:
description: 'Strip debug symbols from build'
default: 'true'
required: false
verbose:
description: 'Enables verbose mode'
default: 'true'
required: false
# zip options
include_files:
description: 'List space-separated of files to include in the release'
default: ''
required: false
# release options
is_draft:
description: 'Mark release is a draft'
default: 'false'
required: false
is_prerelease:
description: 'Mark release is a prerelease'
default: 'false'
required: false
dry_run:
description: 'Skips creation of a release'
default: 'false'
required: false
runs:
using: "composite"
steps:
- name: Install SDK
uses: idleberg/[email protected]
with:
quiet: ${{ inputs.quiet }}
- name: Build Project
shell: bash
run: |
pdc_args=""
pdc_args+=" ${{ inputs.compress == 'false' && '--no-compress' || '' }}"
pdc_args+=" ${{ inputs.quiet == 'true' && '--quiet' || '' }}"
pdc_args+=" ${{ inputs.strip == 'true' && '--strip' || '' }}"
pdc_args+=" ${{ inputs.verbose == 'true' && inputs.quiet != 'true' && '--verbose' || '' }}"
pdc_args+=" ${{ inputs.input }}"
pdc_args+=" ${{ inputs.output }}.pdx"
pdc $pdc_args;
zip_args="-r -9"
zip_args+=" ${{ inputs.quiet == 'true' && '-q' || '' }}"
zip_args+=" ${{ inputs.verbose == 'true' && inputs.quiet != 'true' && '-v' || '' }}"
zip_args+=" ${{ inputs.output }}-${{ github.ref_name }}.zip"
zip_args+=" ${{ inputs.output }}.pdx"
zip_args+=" ${{ inputs.include_files }}"
zip $zip_args;
- name: Create Release
uses: actions/create-release@v1
id: create_release
if: ${{ inputs.dry_run == 'false' }}
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: ${{ inputs.is_draft }}
prerelease: ${{ inputs.is_prerelease }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
if: ${{ inputs.dry_run == 'false' }}
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ inputs.output }}-${{ github.ref_name }}.zip
asset_name: ${{ inputs.output }}-${{ github.ref_name }}.zip
asset_content_type: application/zip