From 3e709a8dbf2b4ed5aaec96b177cae4a62243d1f9 Mon Sep 17 00:00:00 2001 From: Valentin Kiselev Date: Mon, 18 Nov 2024 12:19:54 +0300 Subject: [PATCH] ci: automate publishing to cloudsmith --- .github/workflows/release.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85d921dc..303f124b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,7 +151,7 @@ jobs: uses: dawidd6/action-homebrew-bump-formula@v3 with: formula: lefthook - token: ${{secrets.HOMEBREW_TOKEN}} + token: ${{ secrets.HOMEBREW_TOKEN }} publish-winget: needs: build @@ -163,3 +163,33 @@ jobs: identifier: evilmartians.lefthook fork-user: mrexox token: ${{ secrets.WINGET_TOKEN }} + + publish-distro-packages: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/download-artifact@v4 + with: + name: dist + - run: tar -xvf dist.tar + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: python -m pip install --upgrade cloudsmith-cli + + - name: Push packages to Cloudsmith + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + run: | + cloudsmith push deb evilmartians/lefthook/distro/release dist/lefthook_*_amd64.deb + cloudsmith push deb evilmartians/lefthook/distro/release dist/lefthook_*_arm64.deb + cloudsmith push rpm evilmartians/lefthook/distro/release dist/lefthook_*_amd64.rpm + cloudsmith push rpm evilmartians/lefthook/distro/release dist/lefthook_*_arm64.rpm + cloudsmith push alpine evilmartians/lefthook/distro/release dist/lefthook_*_amd64.apk + cloudsmith push alpine evilmartians/lefthook/distro/release dist/lefthook_*_arm64.apk