Skip to content

Commit

Permalink
Merge pull request #219 from walkero-gr/create-an-SPE-version-of-clib4
Browse files Browse the repository at this point in the history
Create an spe version of clib4
  • Loading branch information
afxgroup authored Dec 17, 2024
2 parents 65005fc + e256582 commit 3c1b993
Show file tree
Hide file tree
Showing 7 changed files with 253 additions and 115 deletions.
28 changes: 28 additions & 0 deletions .github/actions/compile/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Compile clib4
description: "Compile clib4 with gcc for AmigaOS 4"

inputs:
spe:
description: 'Compile with SPE'
required: false
default: "no"
git_tag:
description: 'Git tag to use'
required: false

runs:
using: "composite"
steps:
- name: compiling
shell: bash
if: ${{ inputs.spe != 'yes' }}
run: |
cd /opt/code && \
make -j1 -f GNUmakefile.os4 OS=os4 GITTAG=${{ inputs.git_tag }}
- name: compiling SPE
shell: bash
if: ${{ inputs.spe == 'yes' }}
run: |
cd /opt/code && \
make -j1 -f GNUmakefile.os4 OS=os4 SPE=yes GITTAG=${{ inputs.git_tag }}
15 changes: 15 additions & 0 deletions .github/actions/install-gh/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Install GitHub CLI
description: "Install GitHub CLI binary"

runs:
using: "composite"
steps:
- name: Install GitHub CLI binary
shell: bash
run: |
mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
23 changes: 23 additions & 0 deletions .github/actions/os4depot-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release to OS4Depot
description: "Release clib4 to OS4Depot"

# runs:
# using: "composite"
# steps:
# - name: Prepare OS4Depot release
# run: |
# mkdir os4depot-release
# cp clib4-${{ github.event.release.tag_name }}.lha ./os4depot-release/clib4.lha
# cp ./os4depot.readme ./os4depot-release/clib4_lha.readme
# sed -i "s/VERSION_TAG/${{ github.event.release.tag_name }}/" ./os4depot-release/os4depot.readme
# sed -i "s/OS4DEPOT_PASSPHRASE/${{ secrets.OS4DEPOT_PASSPHRASE }}/" ./os4depot-release/os4depot.readme

# - name: Release on OS4Depot
# uses: SamKirkland/FTP-Deploy-Action@v4.3.4
# with:
# server: os4depot.net
# port: 21
# username: ftp
# password:
# server-dir: ./upload
# local-dir: /opt/code/os4depot-release/
116 changes: 116 additions & 0 deletions .github/workflows/_compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Compile for PowerPC

on:
workflow_call:
inputs:
git_tag:
description: 'Git tag to use'
required: true
type: string
gcc:
description: 'GCC version to use'
required: true
default: 11
type: string
spe:
description: 'Compile with SPE'
required: false
default: "no"
type: string

env:
archive_name: clib4-${{ inputs.git_tag }}${{ inputs.spe == 'yes' && '_SPE' || '' }}

jobs:
compile:
runs-on: ubuntu-latest
container:
image: walkero/amigagccondocker:os4-gcc${{ inputs.gcc }}
volumes:
- '${{ github.workspace }}:/opt/code'
steps:
- name: Pull code
uses: actions/checkout@v4

- name: Add repository to git safe directories
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory /opt/code
- name: Compile clib4
uses: ./.github/actions/compile
with:
git_tag: ${{ inputs.git_tag }}
spe: ${{ inputs.spe }}

- name: Create the LHA release archive
run: |
make -f GNUmakefile.os4 release && \
mv clib4.lha ${{ env.archive_name }}.lha
- name: Create the DEB release archive
run: |
make -f GNUmakefile.os4 dpkg DPKG_LIB=${{ env.archive_name }}_amd64
- name: Upload LHA release file in GitHub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /opt/code/${{ env.archive_name }}.lha
asset_name: ${{ env.archive_name }}.lha
asset_content_type: application/x-lzh-compressed

- name: Install GitHub binary
uses: ./.github/actions/install-gh

- name: Upload DEB release file in GitHub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /opt/code/${{ env.archive_name }}_amd64.deb
asset_name: ${{ env.archive_name }}_amd64.deb
asset_content_type: application/vnd.debian.binary-pac

- name: Upload DEB release file to the server
uses: kostya-ten/ssh-server-deploy@v4
with:
host: ${{ secrets.DEBSERVER_HOST }}
port: ${{ secrets.DEBSERVER_PORT }}
username: ${{ secrets.DEBSERVER_USERNAME }}
private_key: ${{ secrets.DEBSERVER_PRIVATE_KEY }}
scp_source: ${{ env.archive_name }}.deb
scp_target: /opt/amigarepo/ubuntu/pool/main
before_script: |
rm /opt/amigarepo/ubuntu/pool/main/clib4*.deb
after_script: |
/root/regenerate-packages.sh
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Release ${{ inputs.git_tag }} changes
branch: release/${{ inputs.git_tag }}
base: master
body: Automated changes as part of the release
title: Version files changes by the github bot

- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash

- name: Notify on Discord on successful release
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_ANNOUNCEMENTS_ID }}
webhook_token: ${{ secrets.DISCORD_ANNOUNCEMENTS_TOKEN }}
message: "New release of clib4 ${{ inputs.spe == 'yes' && 'SPE' || '' }}: **${{ inputs.git_tag }}** has been created. Check it out at: https://github.com/AmigaLabs/clib4/releases/tag/${{ inputs.git_tag }}"
username: GitHub Actions
avatar_url: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
119 changes: 16 additions & 103 deletions .github/workflows/makeRelease.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Make a new release

on:
release:
branches:
Expand All @@ -7,106 +8,18 @@ on:
- published

jobs:
run:
name: Build latest code
runs-on: ubuntu-latest
container:
image: walkero/amigagccondocker:os4-gcc11
volumes:
- '${{ github.workspace }}:/opt/code'
steps:
- name: Pull code
uses: actions/checkout@v4
- name: Add repository to git safe directories
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory /opt/code
- name: Compile clib4
run: |
cd /opt/code && \
make -j1 -f GNUmakefile.os4 OS=os4 GITTAG=${{ github.event.release.tag_name }}
- name: Create the LHA release archive
run: |
make -f GNUmakefile.os4 release && \
mv clib4.lha clib4-${{ github.event.release.tag_name }}.lha
- name: Create the DEB release archive
run: |
make -f GNUmakefile.os4 dpkg DPKG_LIB=clib4-${{ github.event.release.tag_name }}_amd64
- name: Upload LHA release file in GitHub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}.lha
asset_name: clib4-${{ github.event.release.tag_name }}.lha
asset_content_type: application/x-lzh-compressed
- name: Install gh binary
run: |
mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
- name: Upload DEB release file in GitHub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}_amd64.deb
asset_name: clib4-${{ github.event.release.tag_name }}_amd64.deb
asset_content_type: application/vnd.debian.binary-pac
- name: Upload DEB release file to the server
uses: kostya-ten/ssh-server-deploy@v4
with:
host: ${{ secrets.DEBSERVER_HOST }}
port: ${{ secrets.DEBSERVER_PORT }}
username: ${{ secrets.DEBSERVER_USERNAME }}
private_key: ${{ secrets.DEBSERVER_PRIVATE_KEY }}
scp_source: clib4-${{ github.event.release.tag_name }}_amd64.deb
scp_target: /opt/amigarepo/ubuntu/pool/main
before_script: |
rm /opt/amigarepo/ubuntu/pool/main/clib4*.deb
after_script: |
/root/regenerate-packages.sh
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Release ${{ github.event.release.tag_name }} changes
branch: release/${{ github.event.release.tag_name }}
base: master
body: Automated changes as part of the release
title: Version files changes by the github bot
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash
# - name: Prepare OS4Depot release
# run: |
# mkdir os4depot-release
# cp clib4-${{ github.event.release.tag_name }}.lha ./os4depot-release/clib4.lha
# cp ./os4depot.readme ./os4depot-release/clib4_lha.readme
# sed -i "s/VERSION_TAG/${{ github.event.release.tag_name }}/" ./os4depot-release/os4depot.readme
# sed -i "s/OS4DEPOT_PASSPHRASE/${{ secrets.OS4DEPOT_PASSPHRASE }}/" ./os4depot-release/os4depot.readme
# - name: Release on OS4Depot
# uses: SamKirkland/FTP-Deploy-Action@v4.3.4
# with:
# server: os4depot.net
# port: 21
# username: ftp
# password:
# server-dir: ./upload
# local-dir: /opt/code/os4depot-release/
- name: Notify on Discord on successful release
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_ANNOUNCEMENTS_ID }}
webhook_token: ${{ secrets.DISCORD_ANNOUNCEMENTS_TOKEN }}
message: "New release of clib4: **${{ github.event.release.tag_name }}** has been created. Check it out at: https://github.com/AmigaLabs/clib4/releases/tag/${{ github.event.release.tag_name }}"
username: GitHub Actions
avatar_url: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
compile-ppc:
name: Build for PowerPC cpus
uses: ./.github/workflows/_compile.yml
with:
git_tag: ${{ github.event.release.tag_name }}
gcc: 11
spe: "no"

compile-spe:
name: Build for PowerPC SPE cpus
uses: ./.github/workflows/_compile.yml
with:
git_tag: ${{ github.event.release.tag_name }}
gcc: 6
spe: "yes"
34 changes: 28 additions & 6 deletions .github/workflows/mergeMaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,42 @@ on:
- closed

jobs:
run_if_merged:
compile-ppc:
name: Build for PowerPC cpus
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
name: Build latest code
container:
image: walkero/amigagccondocker:os4-gcc11
volumes:
- '${{ github.workspace }}:/opt/code'
steps:
- name: Pull code
uses: actions/checkout@v4

- name: Compile clib4
uses: ./.github/actions/compile
with:
spe: "no"

- name: Create the release archive
run: make -f GNUmakefile.os4 release

compile-spe:
name: Build for PowerPC SPE cpus
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
container:
image: walkero/amigagccondocker:os4-gcc11-exp
image: walkero/amigagccondocker:os4-gcc6
volumes:
- '${{ github.workspace }}:/opt/code'
steps:
- name: Pull code
uses: actions/checkout@v4

- name: Compile clib4
run: |
cd /opt/code && \
make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no
uses: ./.github/actions/compile
with:
spe: "yes"

- name: Create the release archive
run: make -f GNUmakefile.os4 release
Loading

0 comments on commit 3c1b993

Please sign in to comment.