From e4c188ee8b28de680efe12c4c75c27345894cbdd Mon Sep 17 00:00:00 2001 From: Cory Sanin Date: Wed, 29 Oct 2025 09:51:05 -0500 Subject: [PATCH] add action and example --- action.yml | 37 +++++++++++++++++++++++++++++++++++++ workflows/publish.yml | 18 ++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 action.yml create mode 100644 workflows/publish.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..d230d7d --- /dev/null +++ b/action.yml @@ -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 }} diff --git a/workflows/publish.yml b/workflows/publish.yml new file mode 100644 index 0000000..b29ad8e --- /dev/null +++ b/workflows/publish.yml @@ -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 }}"