sourcegit/.github/workflows/publish-packages.yml
2024-12-03 14:05:43 +05:00

49 lines
1.5 KiB
YAML

name: Publish to PackageCloud
on:
workflow_call:
inputs:
version:
description: SourceGit package version
required: true
type: string
secrets:
PACKAGECLOUD_TOKEN:
required: true
jobs:
publish:
name: Publish to PackageCloud
runs-on: ubuntu-latest
strategy:
matrix:
runtime: [linux-x64, linux-arm64]
steps:
- name: Download and unpack buildkite CLI # ugly, but the only way for now
run: |
curl -s https://api.github.com/repos/buildkite/cli/releases/latest \
| grep "browser_download_url.*amd64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -i - -O - \
| tar -xz \
&& mv bk_*/bk . \
&& rm bk_* -rfd
- name: Download package artifacts
uses: actions/download-artifact@v4
with:
name: package.${{ matrix.runtime }}
path: packages
- name: Publish DEB package
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: |
curl -X POST https://api.buildkite.com/v2/packages/organizations/stone-w4tch3r/registries/sourcegit-fork-test-deb/packages \
-H "Authorization: Bearer $PACKAGECLOUD_TOKEN" \
-F "file=build/sourcegit-0.0.1-1.x86_64.rpm"
- name: Publish RPM package
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: |
package_cloud push stone-w4tch3r/sourcegit-fork-test-rpm/rpm_any/rpm_any packages/*.rpm