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 }}"