Skip to content

Commit

Permalink
Create action (#1)
Browse files Browse the repository at this point in the history
Created an action script and a test workflow that runs on every push
  • Loading branch information
yjpictures authored Nov 5, 2023
1 parent 38480c0 commit 469a08a
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 21 deletions.
34 changes: 34 additions & 0 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'GTK for Windows'
author: 'Yash Jain'
description: 'This will add GTK+ in Windows Runtime Environment'

runs:

using: "composite"

steps:

- name: Message for Non-Windows Users
if: runner.os != 'Windows'
shell: bash
env:
THIS_OS: ${{ runner.os }}
run: echo "::warning title=GTK for Windows::GTK for Windows is not supported on any operating systems other than Windows. You are attempting to use it on $THIS_OS."


- name: Import GTK-for-Windows-Runtime-Environment-Installer
uses: actions/checkout@v4
if: runner.os == 'Windows'
with:
repository: tschoonj/GTK-for-Windows-Runtime-Environment-Installer
path: _tempGTK
sparse-checkout: gtk-nsis-pack
sparse-checkout-cone-mode: false
clean: false

- name: Add to ENV
if: runner.os == 'Windows'
shell: powershell
run: |
$Env:PATH += "$PWD\_tempGTK\gtk-nsis-pack\bin"
echo "$PWD\_tempGTK\gtk-nsis-pack\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Test GTK for Windows

on:
push

jobs:

use-GTK:

name: Use GTK to convert MD to PDF
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
runs-on: ${{ matrix.os }}

steps:

- name: Checkout the actions folder
uses: actions/checkout@v4
with:
sparse-checkout: .github/actions
sparse-checkout-cone-mode: false

- name: Dowload mdPDFinator
uses: robinraju/release-downloader@v1.8
with:
repository: yjpictures/mdPDFinator
latest: true
fileName: mdPDFinator-Windows.exe

- name: Download sample markdown
run: curl ${{ vars.SAMPLE_MARKDOWN_URL }} -o sample.md

- name: Add GTK
uses: ./.github/actions

- name: Test it out
run: ./mdPDFinator-Windows sample.md -o output-${{ matrix.os }}.pdf

- name: Upload the converted PDF file
uses: actions/upload-artifact@v3
with:
name: test-output
path: output-${{ matrix.os }}.pdf

use-GTK-non-supported:

name: Test out non-supported OSs
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:

- name: Checkout the actions folder
uses: actions/checkout@v4
with:
sparse-checkout: .github/actions
sparse-checkout-cone-mode: false

- name: Add GTK
uses: ./.github/actions
21 changes: 0 additions & 21 deletions action.yml

This file was deleted.

0 comments on commit 469a08a

Please sign in to comment.