diff --git a/.github/workflows/pling-release-upload.yml b/.github/workflows/pling-release-upload.yml new file mode 100644 index 0000000..e518ead --- /dev/null +++ b/.github/workflows/pling-release-upload.yml @@ -0,0 +1,58 @@ +name: Pling Release Upload + +on: + push: + tags: + - "release*" + +jobs: + upload-to-pling: + runs-on: ubuntu-latest + permissions: + contents: read + env: + PLING_PROJECT_ID: ${{ secrets.PLING_PROJECT_ID }} + PLING_USERNAME: ${{ secrets.PLING_USERNAME }} + PLING_PASSWORD: ${{ secrets.PLING_PASSWORD }} + PLING_BASE_URL: https://www.opendesktop.org + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Set up uv + uses: astral-sh/setup-uv@v4 + + - name: Validate required secrets + shell: bash + run: | + set -euo pipefail + for var in PLING_PROJECT_ID PLING_USERNAME PLING_PASSWORD; do + if [ -z "${!var:-}" ]; then + echo "::error::Missing required secret: $var" + exit 1 + fi + done + + - name: Install dependencies + run: uv sync --frozen + + - name: Generate upload files + shell: bash + run: | + set -euo pipefail + content='These are files auto uploaded to Pling via GIthub Actions' + test_file="test_${GITHUB_SHA}.md" + + printf '%s\n' "$content" > "$test_file" + printf '%s\n' "$content" > README.md + + echo "TEST_FILE=$test_file" >> "$GITHUB_ENV" + + - name: Upload generated files to Pling + run: uv run python scripts/pling_upload.py -f "$TEST_FILE" -f "README.md"