Refactored with ChatGPT
All checks were successful
Build and publish Ruby binaries / build (ubuntu-22.04, 3.4.2) (push) Successful in 21m19s

This commit is contained in:
Florian Weber 2025-04-17 19:58:56 +00:00 committed by Gitea
parent 2960742e13
commit 010c71ef4b
Signed by: Gitea
GPG Key ID: CAAFB340702C1B49

View File

@ -1,14 +1,11 @@
name: Building binaries
name: Build and publish Ruby binaries
on:
# Runs on pushes targeting the default branch
push:
branches:
- main
# Runs every day at 1 a.m.
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
@ -19,21 +16,44 @@ jobs:
version: ["3.4.2"]
runs-on: ${{ matrix.os }}
steps:
- name: setup and package Ruby
# 1) Code auschecken
- name: Checkout repository
uses: actions/checkout@v3
# 2) System-Dependencies installieren
- name: Install build dependencies
run: |
apt-get update && \
apt-get install curl wget tar build-essential zlib1g-dev gpg -y && \
curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \
curl -sSL https://get.rvm.io | bash -s stable && \
source /etc/profile.d/rvm.sh && \
rvm get head && \
rvm install ${{ matrix.version }} && \
ruby -v && \
rvm prepare ${{ matrix.version }} && \
ls -la
- name: push binaries
sudo apt-get update
sudo apt-get install -y curl wget tar build-essential zlib1g-dev gpg
# 3) RVM installieren & Ruby bauen
- name: Install RVM & build Ruby
run: |
curl -X POST -H "Authorization: token ${{ secrets.PACKAGES_TOKEN }}" \
--upload-file ./ruby-${{ matrix.version }}.tar.bz2 \
"${{ github.api_url }}/api/packages/${{ github.repository_owner }}/generic/${{ matrix.os }}-aarch64/${{ matrix.version }}/ruby-${{ matrix.version }}.tar.bz2"
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
curl -sSL https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm get head
rvm install ${{ matrix.version }}
ruby -v
rvm prepare ${{ matrix.version }}
# 4) Binaries paketieren
- name: Package Ruby binaries
run: |
# passe /usr/local/rvm/rubies/... ggf. an dein Install-Verzeichnis an
tar -cjf ruby-${{ matrix.version }}.tar.bz2 \
-C /usr/local/rvm/rubies/ruby-${{ matrix.version }} .
# 5) Upload per Gitea-Action
- name: Publish Generic Package to Gitea
# verwendet die offizielle Gitea-Package-Publish-Action
uses: VAllens/gitea-publish-generic-packages@v1
with:
# falls du eine abweichende API-URL brauchst, sonst weg lassen
owner: ${{ github.repository_owner }}
package_name: ruby-${{ matrix.os }}-aarch64
package_version: ${{ matrix.version }}
token: ${{ secrets.PACKAGES_TOKEN }}
files: |
ruby-${{ matrix.version }}.tar.bz2