diff --git a/action.yml b/action.yml index 0360f46..ea3262d 100644 --- a/action.yml +++ b/action.yml @@ -15,23 +15,59 @@ runs: - name: Checkout uses: actions/checkout@v4 + - name: Get pkgbase versions + shell: bash + run: | + git reset --hard HEAD~1 && \ + cp .artixlinux/pkgbase.yaml ./pkgbase.previous.yaml && \ + git pull && \ + 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 }} + 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 }} 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_test/arch/microverse' + '${{ 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 "fuck you, gitea" + git commit -m "persist publish script" - name: Build package uses: https://git.sanin.dev/packages_test/build-publish/@build + if: ${{ steps.parsed.outputs.build }} 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 }} + with: + mode: delete + parsed-data: ${{ steps.parsed.outputs.parsed-data }} + username: "${{ inputs.username }}" + token: ${{ inputs.token }}