-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from theavege/add/github-actions
add github-actions
- Loading branch information
Showing
13 changed files
with
389 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
name: Make | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 120 | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Build on Linux | ||
if: runner.os == 'Linux' | ||
shell: bash | ||
run: bash -x make.sh build | ||
|
||
- name: Build on Windows | ||
if: runner.os == 'Windows' | ||
shell: powershell | ||
run: pwsh -File make.ps1 build |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#!/usr/bin/env pwsh | ||
############################################################################################################## | ||
|
||
Function Show-Usage { | ||
Return " | ||
Usage: pwsh -File $($PSCommandPath) [OPTIONS] | ||
Options: | ||
build Build program | ||
" | ||
} | ||
|
||
Function Request-File { | ||
ForEach ($REPLY in $args) { | ||
$params = @{ | ||
Uri = $REPLY | ||
OutFile = (Split-Path -Path $REPLY -Leaf).Split('?')[0] | ||
} | ||
Invoke-WebRequest @params | Out-Null | ||
Return $params.OutFile | ||
} | ||
} | ||
|
||
Function Install-Program { | ||
While ($Input.MoveNext()) { | ||
Switch ((Split-Path -Path $Input.Current -Leaf).Split('.')[-1]) { | ||
'msi' { | ||
& msiexec /passive /package $Input.Current | Out-Host | ||
} | ||
'exe' { | ||
& ".\$($Input.Current)" /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART | Out-Host | ||
} | ||
} | ||
Remove-Item $Input.Current | ||
} | ||
} | ||
|
||
Function Build-Project { | ||
$VAR = @{ | ||
Cmd = 'lazbuild' | ||
Url = 'https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Windows%2064%20bits/Lazarus%203.6/lazarus-3.6-fpc-3.2.2-win64.exe?viasf=1' | ||
Path = "C:\Lazarus" | ||
} | ||
Try { | ||
Get-Command $VAR.Cmd | ||
} Catch { | ||
Request-File $VAR.Url | Install-Program | ||
$env:PATH+=";$($VAR.Path)" | ||
Get-Command $VAR.Cmd | ||
} | ||
If ( Test-Path -Path 'use\components.txt' ) { | ||
& git submodule update --recursive --init | Out-Host | ||
& git submodule update --recursive --remote | Out-Host | ||
Get-Content -Path 'use\components.txt' | ForEach-Object { | ||
If ((-not (& lazbuild --verbose-pkgsearch $_ | Out-Null)) -and | ||
(-not (& lazbuild --add-package $_ | Out-Null)) -and | ||
(-not (Test-Path -Path 'use\components.txt'))) { | ||
$OutFile = Request-File "https://packages.lazarus-ide.org/$($_).zip" | ||
Expand-Archive -Path $OutFile -DestinationPath "use\$($_)" -Force | ||
Remove-Item $OutFile | ||
} | ||
} | ||
Get-ChildItem -Filter '*.lpk' -Recurse -File –Path 'use' | ForEach-Object { | ||
& lazbuild --add-package-link $_ | Out-Host | ||
} | ||
} | ||
Get-ChildItem -Filter '*.lpi' -Recurse -File –Path 'src' | ForEach-Object { | ||
& lazbuild --no-write-project --recursive --build-mode=release $_ | Out-Host | ||
} | ||
} | ||
|
||
Function Switch-Action { | ||
$ErrorActionPreference = 'stop' | ||
Set-PSDebug -Strict -Trace 1 | ||
Invoke-ScriptAnalyzer -EnableExit -Path $PSCommandPath | ||
If ($args.count -gt 0) { | ||
Switch ($args[0]) { | ||
'build' { | ||
Build-Project | ||
} | ||
Default { | ||
Show-Usage | ||
} | ||
} | ||
} Else { | ||
Show-Usage | ||
} | ||
} | ||
|
||
############################################################################################################## | ||
Switch-Action @args | Out-Null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env bash | ||
|
||
function priv_clippit | ||
( | ||
cat <<EOF | ||
Usage: bash ${0} [OPTIONS] | ||
Options: | ||
build Build program | ||
EOF | ||
) | ||
|
||
function priv_lazbuild | ||
( | ||
if ! (which lazbuild); then | ||
source '/etc/os-release' | ||
case ${ID:?} in | ||
debian | ubuntu) | ||
sudo apt-get update | ||
sudo apt-get install -y lazarus | ||
;; | ||
esac | ||
fi | ||
if [[ -f 'use/components.txt' ]]; then | ||
git submodule update --init --recursive | ||
git submodule update --recursive --remote | ||
while read -r; do | ||
if [[ -n "${REPLY}" ]] && | ||
! (lazbuild --verbose-pkgsearch "${REPLY}") && | ||
! (lazbuild --add-package "${REPLY}") && | ||
! [[ -f "use/${REPLY}" ]]; then | ||
declare -A VAR=( | ||
[url]="https://packages.lazarus-ide.org/${REPLY}.zip" | ||
[out]=$(mktemp) | ||
) | ||
wget --output-document "${VAR[out]}" "${VAR[url]}" >/dev/null | ||
unzip -o "${VAR[out]}" -d "use/${REPLY}" | ||
rm --verbose "${VAR[out]}" | ||
fi | ||
done < 'use/components.txt' | ||
find 'use' -type 'f' -name '*.lpk' -exec lazbuild --add-package-link {} + | ||
fi | ||
find 'src' -type 'f' -name '*.lpi' \ | ||
-exec lazbuild --no-write-project --recursive --no-write-project --build-mode=release {} + 1>&2 | ||
) | ||
|
||
function priv_main | ||
( | ||
set -euo pipefail | ||
if ((${#})); then | ||
case ${1} in | ||
build) priv_lazbuild ;; | ||
*) priv_clippit ;; | ||
esac | ||
else | ||
priv_clippit | ||
fi | ||
) | ||
|
||
priv_main "${@}" >/dev/null |
File renamed without changes.
Oops, something went wrong.