Skip to content

Commit

Permalink
Reconfigure workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rdipardo committed Jan 5, 2025
1 parent c418127 commit 9e2acae
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 32 deletions.
45 changes: 33 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# SPDX-FileCopyrightText: (c) 2024 Robert Di Pardo
# SPDX-FileCopyrightText: (c) 2024,2025 Robert Di Pardo
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Permitted usage is detailed in the COPYING file.
Expand All @@ -14,22 +14,36 @@ on:
- '.github/workflows/build.yml'
pull_request:

permissions:
contents: read

env:
LAZARUS_VERSION: '3.4'
LAZARUS_VERSION: '3.6'
ARTIFACT_NAME: fpgeanyplugindemo

jobs:
linux-make-all:
runs-on: ubuntu-latest
outputs:
docs-changed: ${{ steps.changes.outputs.paths }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
fetch-depth: 0
- name: Run fpdocs file filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
base: ${{ github.ref_name }}
filters: |
paths:
- 'docs/**'
- '.github/workflows/fpdocs.yml'
- name: Restore Lazarus packages
id: lazarus-deb-cache
uses: actions/cache@v4
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: '/tmp/lazarus-src'
key: lazarus-${{ env.LAZARUS_VERSION }}-${{ runner.os }}
Expand All @@ -46,7 +60,7 @@ jobs:
- name: Build package and sample plugin
run: make
- name: Upload ${{ env.ARTIFACT_NAME }}.so
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: ${{ env.ARTIFACT_NAME }}.so
path: example/bin/x86_64-linux/Release/${{ env.ARTIFACT_NAME }}.so
Expand All @@ -55,20 +69,18 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Restore Lazarus installer
id: lazarus-exe-cache
uses: actions/cache@v4
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: 'C:\lazarus-src'
key: lazarus-${{ env.LAZARUS_VERSION }}-${{ runner.os }}
- name: Install Lazarus ${{ env.LAZARUS_VERSION }}
shell: bash
run: |
curl -sSL https://bitbucket.org/rdipardo/lazarus-orb/raw/alpha/src/scripts/install_windows_lazarus.sh | bash
./install.cmd
irm -Uri https://bitbucket.org/rdipardo/lazarus-orb/raw/alpha/src/scripts/install_windows_lazarus.ps1 | iex
- name: Install GTK
uses: msys2/setup-msys2@v2
uses: msys2/setup-msys2@d44ca8e88d8b43d56cf5670f91747359d5537f97 # v2.26.0
with:
location: 'C:\Users\Public'
msystem: mingw64
Expand All @@ -80,7 +92,16 @@ jobs:
- name: Build plugin
run: lazbuild --ws=gtk3 .\example\fpgeanyplugindemo.lpr
- name: Upload ${{ env.ARTIFACT_NAME }}.dll
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: ${{ env.ARTIFACT_NAME }}.dll
path: example/bin/x86_64-win64/Release/${{ env.ARTIFACT_NAME }}.dll

publish-docs:
needs: linux-make-all
if: ${{ needs.linux-make-all.outputs.docs-changed == 'true' }}
uses: rdipardo/fpgeanyplugin/.github/workflows/fpdocs.yml@main
with:
lazarus-version: '3.6'
permissions:
id-token: write
32 changes: 13 additions & 19 deletions .github/workflows/fpdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@
name: Publish Docs

on:
push:
paths:
- 'docs/**'
- '.github/workflows/fpdocs.yml'

permissions:
contents: read
pages: write
id-token: write

env:
LAZARUS_VERSION: '3.4'
workflow_call:
inputs:
lazarus-version:
required: true
type: string

jobs:
deploy:
Expand All @@ -27,30 +20,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Restore Lazarus packages
id: lazarus-deb-cache
uses: actions/cache@v4
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: '/tmp/lazarus-src'
key: lazarus-${{ env.LAZARUS_VERSION }}-${{ runner.os }}
- name: Install Lazarus ${{ env.LAZARUS_VERSION }}
key: lazarus-${{ inputs.lazarus-version }}-${{ runner.os }}
- name: Install Lazarus ${{ inputs.lazarus-version }}
run: |
curl -sSL https://bitbucket.org/rdipardo/lazarus-orb/raw/alpha/src/scripts/install_lazarus.sh | bash
env:
# https://askubuntu.com/a/1421221
NEEDRESTART_MODE: l
DEBIAN_FRONTEND: noninteractive
LAZARUS_VERSION: ${{ inputs.lazarus-version }}
- name: Generate docs
run: |
sudo chown -R $USER /usr/share/lazarus
docs/build
- name: Setup Pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: './docs/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
2 changes: 1 addition & 1 deletion scripts/build_gtk3_widgets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BASE_PATH="$(dirname "$0")"
FPC_CFG="$BASE_PATH/../gtk3.cfg"
[ -f "$FPC_CFG" ] && exit 0
echo "Building LCL for GTK3. To rebuild, delete $FPC_CFG".
LPK=$(lazbuild --add-package lcl --verbose | awk -F '"' '/(adding package)/{print $2}')
LPK=$(lazbuild --add-package lcl --verbose | awk -F '"' 'BEGIN{IGNORECASE=1}/(adding package)/{print $2}')
CMDLINE="lazbuild -B --bm=${1:-Release} $LPK --ws=gtk3 --verbose"
OUT=$(${CMDLINE}| awk -F '"' '/(\(lazarus\) Param.*="-FU)/{print $2}')
[ ! -f "${OUT#-FU}/gtk3int.ppu" ] && \
Expand Down

0 comments on commit 9e2acae

Please sign in to comment.