Refactored with ChatGPT
All checks were successful
Build and publish Ruby binaries / build (ubuntu-22.04, 3.4.2) (push) Successful in 21m19s
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:
parent
2960742e13
commit
010c71ef4b
@ -1,14 +1,11 @@
|
|||||||
name: Building binaries
|
name: Build and publish Ruby binaries
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Runs on pushes targeting the default branch
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
# Runs every day at 1 a.m.
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 1 * * *'
|
- cron: '0 1 * * *'
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -19,21 +16,44 @@ jobs:
|
|||||||
version: ["3.4.2"]
|
version: ["3.4.2"]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
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: |
|
run: |
|
||||||
apt-get update && \
|
sudo apt-get update
|
||||||
apt-get install curl wget tar build-essential zlib1g-dev gpg -y && \
|
sudo apt-get install -y curl wget tar build-essential zlib1g-dev gpg
|
||||||
curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \
|
|
||||||
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \
|
# 3) RVM installieren & Ruby bauen
|
||||||
curl -sSL https://get.rvm.io | bash -s stable && \
|
- name: Install RVM & build Ruby
|
||||||
source /etc/profile.d/rvm.sh && \
|
|
||||||
rvm get head && \
|
|
||||||
rvm install ${{ matrix.version }} && \
|
|
||||||
ruby -v && \
|
|
||||||
rvm prepare ${{ matrix.version }} && \
|
|
||||||
ls -la
|
|
||||||
- name: push binaries
|
|
||||||
run: |
|
run: |
|
||||||
curl -X POST -H "Authorization: token ${{ secrets.PACKAGES_TOKEN }}" \
|
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
|
||||||
--upload-file ./ruby-${{ matrix.version }}.tar.bz2 \
|
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
|
||||||
"${{ github.api_url }}/api/packages/${{ github.repository_owner }}/generic/${{ matrix.os }}-aarch64/${{ matrix.version }}/ruby-${{ matrix.version }}.tar.bz2"
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user