add action and example
This commit is contained in:
37
action.yml
Normal file
37
action.yml
Normal 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
18
workflows/publish.yml
Normal 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 }}"
|
||||
Reference in New Issue
Block a user