Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Jun 15, 2022
0 parents commit 2ac0db6
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

root = true

[*]
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true

[*.{markdown,md}]
trim_trailing_whitespace = false
20 changes: 20 additions & 0 deletions .github/source/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import "CoreLibs/graphics"

local gfx <const> = playdate.graphics
local display <const> = playdate.display

function init()
local message = "Hello World"
local messageWidth, messageHeight = gfx.getTextSize(message)

gfx.drawText(
message,
(display.getWidth() / 2) - (messageWidth / 2),
(display.getHeight() / 2) - (messageHeight / 2)
)
end

init()

function playdate.update()
end
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

name: Tests

on:
push

jobs:
test-run:
strategy:
matrix:
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: idleberg/setup-playdate-sdk@main

- name: Test environment variable
run: |
if [ -z "${PLAYDATE_SDK_PATH}" ]; then
echo "PLAYDATE_SDK_PATH is not defined or empty"
exit 1
fi
$PLAYDATE_SDK_PATH/bin/pdc --version
- name: Print version
run: pdc --version

- name: Compile game
run: pdc --verbose ${GITHUB_WORKSPACE}/.github/source
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pdx
*.pdz
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Jan T. Sott

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# setup-playdate-sdk

> A GitHub action that installs the Playdate SDK.
## Usage

Configure a step that adds the `idleberg/setup-playdate-sdk` action to your workflow. Optionally, you can pass the following parameters via `with`

See [`test.yml`](https://github.com/idleberg/setup-playdate-sdk/blob/main/.github/workflows/test.yml) for an example.

### Options

#### install_sdk

Default: `true`

Install Playdate SDK if true

#### sdk_version

Default: `latest`

Specify the version of the SDK

#### set_env_var

Default: `true`

Set `PLAYDATE_SDK_PATH` environment variable

#### update_path

Default: `true`

Update environment variable PATH for workflow if true

## License

This work is licensed under [The MIT License](LICENSE).
34 changes: 34 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Setup Playdate SDK'
description: 'Setup the Playdate SDK and expose its build tools'
inputs:
install_sdk:
description: 'Install Playdate SDK if true (default)'
required: true
default: 'true'
sdk_version:
description: 'Specify the version of the SDK (defaults to latest)'
required: true
default: 'latest'
set_env_var:
description: 'Set PLAYDATE_SDK_PATH environment variable (default)'
default: 'true'
update_path:
description: 'Update environment variable PATH for workflow if true (default)'
required: true
default: 'true'
runs:
using: "composite"
steps:
- name: 'Setup Playdate SDK'
shell: bash
if: ${{ inputs.install_sdk == 'true' }}
run: |
curl -s https://download.panic.com/playdate_sdk/Linux/PlaydateSDK-${{ inputs.sdk_version }}.tar.gz -L | tar xvzf - -C ${{ runner.temp }}
- name: 'Set PLAYDATE_SDK_PATH environment variable'
shell: bash
if: ${{ inputs.set_env_var == 'true' }}
run: echo "PLAYDATE_SDK_PATH=${{ runner.temp }}/$(ls -t -U ${{ runner.temp }} | grep -m 1 "PlaydateSDK")" >> $GITHUB_ENV
- name: 'Update PATH'
shell: bash
if: ${{ inputs.update_path == 'true' }}
run: echo "${{ runner.temp }}/$(ls -t -U ${{ runner.temp }} | grep -m 1 "PlaydateSDK")/bin" >> $GITHUB_PATH

0 comments on commit 2ac0db6

Please sign in to comment.