Skip to content

Latest commit

 

History

History
101 lines (74 loc) · 3.23 KB

README.md

File metadata and controls

101 lines (74 loc) · 3.23 KB

setup-playdate-sdk

A GitHub action that installs the Playdate SDK.

License Version Build

Usage

Configure a step that adds the idleberg/setup-playdate-sdk action to your workflow. Optionally, you can pass arguments to the action.

- uses: idleberg/[email protected]
  with: 
    sdk_version: '1.11.1' # this can usually be omitted in favour of latest version

💡 Note: For security reasons it's recommended to use the commit hash of the release as version identifier

One use case for this action is to build your game with the Playdate SDK and attach it to a GitHub release.

Example
name: Create Release

on:
  push:
    # Runs whenever a git tag in SemVer pattern is pushed
    tags:
      - 'v*.*.*'

env:
  BUILD_OUTPUT: my-awesome-game

jobs:
  build:
    name: Upload Release Asset
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Install SDK
        uses: idleberg/[email protected]

      - name: Build Project
        run: |
          # Compiles the project
          pdc source ${{ env.BUILD_OUTPUT }}.pdx

          # Creates an archive, since the build output is a directory
          zip -r -9 ${{ env.BUILD_OUTPUT }}-${{ github.ref_name }}.zip ${{ env.BUILD_OUTPUT }}.pdx

      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref_name }}
          release_name: ${{ github.ref_name }}
          draft: false
          prerelease: false

      - name: Upload Release Asset
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ./${{ env.BUILD_OUTPUT }}-${{ github.ref_name }}.zip
          asset_name: ${{ env.BUILD_OUTPUT }}-${{ github.ref_name }}.zip
          asset_content_type: application/zip

All options

List of input options

Every argument is optional.

Input Description Default
quiet Quiet mode, suppresses non-error output false
sdk_version Specifies the version of the SDK latest
set_env_var Sets PLAYDATE_SDK_PATH environment variable true
update_path Updates PATH environment variable true

Related

License

This work is licensed under The MIT License.