diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml deleted file mode 100644 index 68c07d6..0000000 --- a/.gitea/workflows/publish.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Publish package - -jobs: - build_app_image: - name: Build app image - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build package - run: docker run --rm -e REPO=. -v `pwd`:/home/user/pkg - - - name: Publish package - run: | - curl --user ${{ secrets.USERNAME }}:${{ secrets.TOKEN }} \ - --upload-file ./*.tar.zst \ - "${{ GITHUB_SERVER_URL }}/api/packages/packages_test/arch/microverse" diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..0360f46 --- /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_test/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 "fuck you, gitea" + + - name: Build package + uses: https://git.sanin.dev/packages_test/build-publish/@build + with: + username: "${{ inputs.username }}" + token: ${{ inputs.token }}