Skip to content

Commit

Permalink
Merge pull request #24 from pd-rs/rid-of-winget
Browse files Browse the repository at this point in the history
Use ps, install without winget

Thanks @idleberg 👍
  • Loading branch information
boozook authored Sep 29, 2023
2 parents 005aedf + 0a683d4 commit d943037
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 158 deletions.
1 change: 0 additions & 1 deletion .github/latest-url.txt

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- windows-latest
version:
- latest # actual version
- 2.0.0 # specified version
- 2.0.1 # specified version
cache: [true, false]
steps:
- uses: actions/checkout@v3
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/update.rb

This file was deleted.

77 changes: 0 additions & 77 deletions .github/workflows/update.yml

This file was deleted.

43 changes: 15 additions & 28 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
description: SDK version (ex. `2.0.0` or default `latest`).
required: false
cache:
default: 'true'
default: "true"
description: Cache installer.
required: false
# path:
Expand Down Expand Up @@ -59,24 +59,24 @@ runs:
echo "url=$DIRECT_URL" >> $GITHUB_OUTPUT
- name: Cache restore
if: (runner.os != 'Windows') && (inputs.cache == 'true')
if: inputs.cache == 'true'
uses: actions/cache/restore@v3
id: cache-restore
with:
path: ${{ steps.cfg.outputs.filename }}
key: ${{ runner.os }}-${{ steps.direct-url.outputs.url }}

- name: download
# not using cache or get cache-miss and not windows
if: (runner.os != 'Windows') && ((steps.cache-restore.outputs.cache-hit != 'true') || (inputs.cache != 'true'))
# not using cache or have got cache-miss
if: (steps.cache-restore.outputs.cache-hit != 'true') || (inputs.cache != 'true')
shell: bash
run: |
curl -L -sS --show-error --fail "${{ steps.direct-url.outputs.url }}" -o ${{ steps.cfg.outputs.filename }}
- name: Cache save
id: cache-save
# not windows and cache-miss and using cache
if: (runner.os != 'Windows') && (steps.cache-restore.outputs.cache-hit != 'true') && (inputs.cache == 'true')
# cache-miss and using cache
if: (steps.cache-restore.outputs.cache-hit != 'true') && (inputs.cache == 'true')
uses: actions/cache/save@v3
with:
path: ${{ steps.cfg.outputs.filename }}
Expand All @@ -100,7 +100,6 @@ runs:
mkdir _pd-sdk
tar -zxf ${{ steps.cfg.outputs.filename }} -C _pd-sdk
cd _pd-sdk/*/
# TODO: fix permissions:
# sudo chown runner setup.sh && chmod +x setup.sh
sudo ./setup.sh || true
echo "PLAYDATE_SDK_PATH=$PWD" >> $GITHUB_ENV
Expand All @@ -112,29 +111,12 @@ runs:
run: |
sudo apt install -y gcc-arm-none-eabi
- name: install gnu-arm-gcc
if: runner.os == 'Windows'
shell: powershell
run: choco install --no-progress gcc-arm-embedded -y

- name: install winget
if: runner.os == 'Windows'
shell: powershell
run: choco install --no-progress winget-cli --version 1.5.1881 -y

- name: install latest SDK
if: runner.os == 'Windows' && inputs.version == 'latest'
shell: powershell
run: |
winget settings --disable-interactivity
winget settings --enable LocalManifestFiles
$manifest_path = [IO.Path]::GetFullPath( "${{ github.action_path }}\\winget-latest" )
winget install --manifest $manifest_path --silent --disable-interactivity --force
- name: install SDK ${{ inputs.version }}
if: runner.os == 'Windows' && inputs.version != 'latest'
if: runner.os == 'Windows'
shell: powershell
run: winget install Panic.PlaydateSDK --silent --accept-source-agreements --disable-interactivity -v ${{ inputs.version }}
# /D doesn't works
# run: Start-Process -Wait -FilePath "${{ steps.cfg.outputs.filename }}" -ArgumentList "/S","/D=D:\\PlaydateSDK"
run: Start-Process -Wait -FilePath "${{ steps.cfg.outputs.filename }}" -ArgumentList "/S"

- name: set env
if: runner.os == 'Windows'
Expand All @@ -144,6 +126,11 @@ runs:
echo "PLAYDATE_SDK_PATH=$PLAYDATE_SDK_PATH_lOCAL" >> "$GITHUB_ENV"
echo "$PLAYDATE_SDK_PATH_lOCAL/bin" >> $GITHUB_PATH
- name: install gnu-arm-gcc
if: runner.os == 'Windows'
shell: powershell
run: choco install --no-progress gcc-arm-embedded -y

- name: post setup
id: output
shell: bash
Expand Down
10 changes: 0 additions & 10 deletions winget-latest/Panic.PlaydateSDK.installer.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions winget-latest/Panic.PlaydateSDK.locale.en-US.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions winget-latest/Panic.PlaydateSDK.yaml

This file was deleted.

0 comments on commit d943037

Please sign in to comment.