This repository has been archived on 2025-11-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
build-publish/action.yml

78 lines
2.5 KiB
YAML

name: Publish package
description: build and publish an Arch package
inputs:
username:
description: 'Gitea username'
required: true
token:
description: 'Gitea PAT'
required: true
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get pkgbase versions
shell: bash
run: |
git reset --hard HEAD~1 && \
cp .artixlinux/pkgbase.yaml ./pkgbase.previous.yaml && \
git pull && \
git config --global user.name 'Guy Incognito' && \
git config --global user.email 'user@local' && \
git add ./pkgbase.previous.yaml && \
git commit -m "add previous pkgbase"
- name: Parse pkgbase
uses: https://git.sanin.dev/packages_test/pkgbase-yaml-parser@master
id: parsed
with:
previous: pkgbase.previous.yaml
current: .artixlinux/pkgbase.yaml
- name: Move package
uses: https://git.sanin.dev/packages_test/pkgbase-yaml-parser@master
if: ${{ steps.parsed.outputs.move == 'true' }}
with:
mode: move
parsed-data: ${{ steps.parsed.outputs.parsed-data }}
username: "${{ inputs.username }}"
token: ${{ inputs.token }}
- name: Create publish script
shell: bash
if: ${{ steps.parsed.outputs.build == 'true' }}
run: |
echo "#!/bin/bash
echo '📤️ Uploading package to ${{ gitea.server_url }} ...'
curl -f --user \"\$username:\$token\" \
--upload-file ./*.tar.zst \
'${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/arch/${{ steps.parsed.outputs.destination }}'
" > "./post-entrypoint.sh"
chmod +x "./post-entrypoint.sh"
git config --global user.name 'Guy Incognito'
git config --global user.email 'user@local'
git add "./post-entrypoint.sh"
git commit -m "persist publish script"
- name: Build package
uses: https://git.sanin.dev/packages_test/build-publish/@build
if: ${{ steps.parsed.outputs.build == 'true' }}
with:
username: "${{ inputs.username }}"
token: ${{ inputs.token }}
- name: Delete package
uses: https://git.sanin.dev/packages_test/pkgbase-yaml-parser@master
if: ${{ steps.parsed.outputs.delete == 'true' }}
with:
mode: delete
parsed-data: ${{ steps.parsed.outputs.parsed-data }}
username: "${{ inputs.username }}"
token: ${{ inputs.token }}