add action and example

This commit is contained in:
2025-10-29 09:51:05 -05:00
parent 209c980af6
commit e4c188ee8b
2 changed files with 55 additions and 0 deletions

37
action.yml Normal file
View File

@@ -0,0 +1,37 @@
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
- name: Create publish script
shell: bash
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/packages/arch/microverse'
" > "./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 script"
- name: Build package
uses: https://git.sanin.dev/packages/build-publish-action/@build
with:
username: "${{ inputs.username }}"
token: ${{ inputs.token }}

18
workflows/publish.yml Normal file
View File

@@ -0,0 +1,18 @@
name: Publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
name: Build and publish
permissions:
contents: read
steps:
- name: Build and publish
uses: https://git.sanin.dev/packages/build-publish-action@master
with:
username: "${{ secrets.USERNAME }}"
token: "${{ secrets.TOKEN }}"