Recent

Author Topic: GitHub action setup-lazarus  (Read 9661 times)

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
GitHub action setup-lazarus
« on: June 03, 2022, 12:01:08 am »
Hey Y'all,

Since I've finally unstuck my thumbs outta my arse, and implemented the full set of features I wanted, I'm now announcing the GitHub action to install Lazarus so you can have CI/CD (Continuous Integration / Continuous Delivery) with your Lazarus projects.

Features so far:
  • Will install the Lazarus/FPC bundle from source forge with the version number of Lazarus
  • Will install packages, and dependencies, of packages from Online Package Manager's(OPM) site https://packages.lazarus-ide.org/
  • With the use of the option with-cache it will no longer download the install archive from source forge, but will use the last one downloaded and cached.
    NOTE: At the moment this is somewhat broken for Windows. The install executable appear to not like being retrieved from cached.

Edit
I completely forgot to mention that there's a companion repository named lazarus-with-github-actions where I test the action itself.
You can have a looksie there, to get an idea on how to get your project up and running.

I hope this will help many of you.

Cheers,
Gus

P.S.: If you'd like a bit more control on what bundles and/or versions to install I suggest using Olly's version, also called setup-lazarus and also with cache.
« Last Edit: June 03, 2022, 09:31:19 am by Gustavo 'Gus' Carreno »

Red_prig

  • Full Member
  • ***
  • Posts: 153
Re: GitHub action setup-lazarus
« Reply #1 on: June 03, 2022, 08:37:44 am »
Not so long ago, I understood this topic, and set up a self-hosted, I got something like this:
Code: Text  [Select][+][-]
  1. # This is a basic workflow to help you get started with Actions
  2.  
  3. name: CI
  4.  
  5. # Controls when the workflow will run
  6. on:
  7.   # Triggers the workflow on push or pull request events but only for the main branch
  8.   push:
  9.     branches: [ main ]
  10.     tags:        
  11.       - '*'
  12.   pull_request:
  13.     branches: [ main ]
  14.  
  15.   # Allows you to run this workflow manually from the Actions tab
  16.   workflow_dispatch:
  17.  
  18. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  19. jobs:
  20.   build_windows:
  21.     # The type of runner that the job will run on
  22.     runs-on: self-hosted
  23.  
  24.     # Steps represent a sequence of tasks that will be executed as part of the job
  25.     steps:
  26.       # Runs a set of commands using the runners shell
  27.       - uses: actions/checkout@v2
  28.       - name: Compile
  29.         shell: cmd
  30.         working-directory: ./fpPS4/spirv
  31.         run: lazbuild -B pssl-spirv.lpi
  32.       - name: Strip
  33.         shell: cmd
  34.         working-directory: ./fpPS4/spirv
  35.         if: startsWith(github.ref, 'refs/tags/')
  36.         run: strip pssl-spirv.exe
  37.       - name: Release
  38.         uses: softprops/action-gh-release@v1
  39.         if: startsWith(github.ref, 'refs/tags/')
  40.         with:
  41.           files: ./fpPS4/spirv/pssl-spirv.exe

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: GitHub action setup-lazarus
« Reply #2 on: June 03, 2022, 09:34:42 am »
Hey Red_prig,

Not so long ago, I understood this topic, and set up a self-hosted, I got something like this:

I really don't know anything about setting up a self hosted runner, sorry.

I've added an addendum to the original post mentioning the companion repository lazarus-with-github-actions where you can get an idea on how to use the action.

Hope this helps.

Cheers,
Gus

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: GitHub action setup-lazarus
« Reply #3 on: June 03, 2022, 09:41:53 am »
Hey friend,

surprising, usually people who say "y'all" outside that particular region in the united states and who are not part of that certain group of people from that region as well, who use sh*thub, put em*jis in documentation, use continuous retardation, tend to like sticking all kinds of things up there, good for you you've stuck it out, seems like a good thing for you since you've mentioned it.
what does this do?

  • First of all, I'm not really liking your tone.
  • I'm Portuguese, so I'm not from any US region.
  • I use the colloquialism Y'all so I don't have to fall into the trap of using any gender.
  • If you don't know what is Continuous Integration / Continuous Deployment (CI/CD), then this is of no interest for you, so run along please.
  • What I do with my arse and what I stick up there is none of your business and you should not have an opinion about it.
  • And the use of emojis is something I quite like, so agree to disagree on this one!

Nuff, said, peace out.

Cheers,
Gus

dbannon

  • Hero Member
  • *****
  • Posts: 3672
    • tomboy-ng, a rewrite of the classic Tomboy
Re: GitHub action setup-lazarus
« Reply #4 on: June 03, 2022, 09:58:47 am »
Hey Gus (and Y'All) thats nice work.

I am, perhaps, not yet ready to give up my ugly bash scripts and a VM full of cross compilers but tempted...

Thanks.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12099
  • Debugger - SynEdit - and more
    • wiki
Re: GitHub action setup-lazarus
« Reply #5 on: June 03, 2022, 02:11:57 pm »

Edited: removed a tirade that was good for nothing but starting a "flame war".
Deleted a 2nd message with the same potential.

@friend: pay more attention to staying on topic: constructive, non-abusive content about Pascal. (final warning)
(for replies to the moderation-team, please use the "report to moderator")

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: GitHub action setup-lazarus
« Reply #6 on: June 03, 2022, 08:12:10 pm »
Hey Davo,

Hey Gus (and Y'All) thats nice work.

Thank you very much!!

I am, perhaps, not yet ready to give up my ugly bash scripts and a VM full of cross compilers but tempted...

Yes, I completely understand. And to be honest, my next plan is to use fpcup and fpclazup in probably another action to get cross compiling working for ARM under ubuntu-latest runners.
But that's another battle to be fought at some other time.

Cheers,
Gus

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: GitHub action setup-lazarus
« Reply #7 on: June 03, 2022, 08:15:09 pm »
Hey Martin,

Edited: removed a tirade that was good for nothing but starting a "flame war".
Deleted a 2nd message with the same potential.

Thanks mate for slapping my hand!!
Sometimes my mouth/fingers lack the fortitude to just shut up and ignore the trolls :(

Cheers,
Gus

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12099
  • Debugger - SynEdit - and more
    • wiki
Re: GitHub action setup-lazarus
« Reply #8 on: June 03, 2022, 08:58:30 pm »
Hey Martin,

Edited: removed a tirade that was good for nothing but starting a "flame war".
Deleted a 2nd message with the same potential.

Thanks mate for slapping my hand!!
Sometimes my mouth/fingers lack the fortitude to just shut up and ignore the trolls :(

This wasn't about any reply/post of yours. They were all fine as far as I am concerned.
"friend" had two messages. I would have deleted both. But one of them had replies. So to keep clarity, and not to leave those replies out of context, I decided to edit that one post.

Anyway lets put that behind us, and get back on topic.


Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: GitHub action setup-lazarus
« Reply #9 on: June 03, 2022, 10:34:45 pm »
Hey Martin,

This wasn't about any reply/post of yours. They were all fine as far as I am concerned.
"friend" had two messages. I would have deleted both. But one of them had replies. So to keep clarity, and not to leave those replies out of context, I decided to edit that one post.

Sorry, my bad, when I read you deleted 2 messages I thought one of them was mine, since I did reply to his bile.
I just scrolled up a bit and found out my messages where still there, so I must apologise for the confusion.

Anyway lets put that behind us, and get back on topic.

Couldn't agree more, so yeah, let's do that!!

And thanks for keeping a vigilant eye on such caustic behaviours :)

Cheers,
Gus

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: GitHub action setup-lazarus
« Reply #10 on: July 16, 2025, 01:03:07 am »
Hey Y'All,

I've been rather frustrated with setup-lazarus for quite a while:
  • I was never a TypeScript expert, heck not even a proper padawan, and it, figuratively, hurt to work on it.
    I just wanted to provide something that worked with the GitHub runners, and not based outside, needing a paid plan.
  • I could never quite get the cache to work and this makes the GitHub action slow, but even more sinful, it makes it wasteful.
  • I was never able to suss out the correct algorithm to determine all the dependencies needed for a certain package, in the proper order.
  • This is a me problem, I know that, but every time the package maintainers that provide their work at Source Forge, change the naming patterns,
    or the type of archive, it just makes triple the work for me to upgrade the action, which takes all the fun out of it!!!
    I know it's not fair to dump on them, cuz they DO very good work... But... keep with the conventions... somebody may be scripting counting on them :D
    And the straw that broke the camel is the Lazarus 4.0 macOS ~300MiB .zip file, instead of the usual .dmg or .pkg.
    This means I now have to download that huge file. See what's in it. Learn what TypeScript, or the core GitHub actions engine, has for unzipping that. Update the action with a new set of conditionals, just for this version, or maybe from now. Install it.
    Where, before, it was just a case of download->install, for ALL supported platforms.

With all this in mind, I decided that maybe I should hand over the baton to a more willing person to maintain it.
The person that, IMMEDIATELY, popped into my mind was @michalis from Castle Engine fame. He uses the action extensively and has even posted some issues when I was slacking in upgrading the action.
I've now offered co-ownership, or even full ownership to him on the Castle Engine Discord server.
I'll wait for his response.
If he bites, then all's good.
If he doesn't want it, I'll come back here to offer it to anyone willing to take it.
If no one wants it, then I guess this is the slow death of the action. I'll be quite sad, but it is, what it is... And I'm sorry for using such a terrible saying :D

Cheers,
Gus
« Last Edit: July 16, 2025, 01:06:43 am by Gustavo 'Gus' Carreno »

michalis

  • Full Member
  • ***
  • Posts: 144
    • Castle Game Engine
Re: GitHub action setup-lazarus
« Reply #11 on: July 19, 2025, 12:05:23 am »
With all this in mind, I decided that maybe I should hand over the baton to a more willing person to maintain it.
The person that, IMMEDIATELY, popped into my mind was @michalis from Castle Engine fame. He uses the action extensively and has even posted some issues when I was slacking in upgrading the action.
I've now offered co-ownership, or even full ownership to him on the Castle Engine Discord server.
I'll wait for his response.
If he bites, then all's good.
If he doesn't want it, I'll come back here to offer it to anyone willing to take it.

Thank you very much for the good words and trust... but I really cannot "bite" :)

I do have too many things on my head, lots of plans around Castle Game Engine, and PasDoc deserves a new release finally too, and I have some other things (around Pascal and games and Castle Game Engine) that may be announced later this year too. So I really should not take more, or I will just have one more project to fail. Sorry!

I do hope some other brave soul will step up and help!

From my side, I can offer testing. We use https://github.com/gcarreno/setup-lazarus in our GitHub Actions, in both Castle Game Engine and PasDoc.

If you're not sure what https://github.com/gcarreno/setup-lazarus is and how to use GitHub Actions, I do recommend to try. If you already have a Pascal (FPC, Lazarus) project hosted on GitHub, then GitHub Actions + https://github.com/gcarreno/setup-lazarus is likely the easiest way to get CI/CD: you can build your project, automatically after every commit, you can then run any automatic tests, maybe even release build "snapshots" as part of GitHub's release and more. See

( Above is a bit rephrase of my answer from Castle Game Engine Discord.  )

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: GitHub action setup-lazarus
« Reply #12 on: July 19, 2025, 12:10:16 am »
Hey Michalis,

Thank you so much for mirroring your answer from Discord !! I was in the middle of doing so when I got the notification that someone answered while I was editing it :D

Same wishes apply here as the ones I wished on said server!!

Cheers,
Gus

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: GitHub action setup-lazarus
« Reply #13 on: July 19, 2025, 12:16:33 am »
Hey Y'All,

Now that @michalis has answered and explained why he can't take over the project...

I'm now extending the ask for someone, anyone, to take the mantle of maintaining this GitHub action.
If no one takes the job, this action will die. Like I sated earlier, I'm no longer willing to keep it current.
This will, of course, disappoint a lot of it's current users, of which, one is  @michalis with Castle Game Engine and PasDoc, just to name a few.

I'll be eternally grateful to the person that takes this project off my hands!!

Please make your intentions known below, or in a quote to this message.

Cheers,
Gus

Alexx2000

  • New Member
  • *
  • Posts: 22
Re: GitHub action setup-lazarus
« Reply #14 on: July 19, 2025, 02:21:11 pm »
Hi, maybe I can some later if no one else appears. I am not a super TypeScript specialist but I am already maintain your GitHub Action fork (with some fixes, additions) which I use in the my project. And I plan to support it in the future.

 

TinyPortal © 2005-2018