bunkerweb/.github/workflows/push-packagecloud.yml
dependabot[bot] aa0add36bc
deps/gha: bump ruby/setup-ruby from 1.292.0 to 1.295.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.292.0 to 1.295.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](4eb9f110ba...319994f95f)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-version: 1.295.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-18 08:05:11 +00:00

106 lines
3.8 KiB
YAML

name: Push packagecloud (REUSABLE)
on:
workflow_call:
inputs:
SEPARATOR:
required: true
type: string
SUFFIX:
required: true
type: string
REPO:
required: true
type: string
LINUX:
required: true
type: string
VERSION:
required: true
type: string
PACKAGE:
required: true
type: string
BW_VERSION:
required: true
type: string
ARCH:
required: true
type: string
PACKAGE_ARCH:
required: true
type: string
secrets:
PACKAGECLOUD_TOKEN:
required: true
jobs:
push:
runs-on: ubuntu-latest
steps:
# Prepare
- name: Check out repository code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install ruby
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0
with:
ruby-version: "3.0"
- name: Install packagecloud
run: gem install package_cloud
# Compute dynamic variables to remove per-distro duplication
- name: Compute distribution & artifact names
id: compute
shell: bash
run: |
LINUX="${{ inputs.LINUX }}"
VERSION="${{ inputs.VERSION }}"
if [[ "$LINUX" =~ ^el-([0-9]+)$ ]]; then
DIST="el/${BASH_REMATCH[1]}"
ARTIFACT_NAME="package-rh${LINUX}-${{ inputs.PACKAGE_ARCH }}"
elif [[ "$LINUX" == ubuntu-* ]]; then
# Expect format ubuntu-<codename>
CODENAME=${LINUX#ubuntu-}
DIST="ubuntu/${CODENAME}"
ARTIFACT_NAME="package-${LINUX}-${{ inputs.PACKAGE_ARCH }}"
elif [[ "$LINUX" == fedora-* ]]; then
FEDVER=${LINUX#fedora-}
DIST="fedora/${FEDVER}"
ARTIFACT_NAME="package-${LINUX}-${{ inputs.PACKAGE_ARCH }}"
elif [[ "$LINUX" == debian-* ]]; then
# Expect format debian-<codename>
CODENAME=${LINUX#debian-}
DIST="debian/${CODENAME}"
ARTIFACT_NAME="package-${LINUX}-${{ inputs.PACKAGE_ARCH }}"
else
DIST="${LINUX}/${VERSION}"
ARTIFACT_NAME="package-${LINUX}-${{ inputs.PACKAGE_ARCH }}"
fi
echo "DIST=$DIST" >> $GITHUB_ENV
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
echo "dist=$DIST" >> $GITHUB_OUTPUT
echo "artifact=$ARTIFACT_NAME" >> $GITHUB_OUTPUT
# Download packages (single generic step)
- name: Download package artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.ARTIFACT_NAME }}
path: /tmp/${{ inputs.LINUX }}
# Yank existing package (generic)
- name: Yank existing package
run: package_cloud yank bunkerity/${{ inputs.REPO }}/${{ env.DIST }} bunkerweb${{ inputs.SEPARATOR }}${{ inputs.BW_VERSION }}${{ inputs.SEPARATOR }}${{ inputs.SUFFIX }}${{ inputs.PACKAGE_ARCH }}.${{ inputs.PACKAGE }}
continue-on-error: true
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
# Update name
- name: Rename package
if: inputs.BW_VERSION == '1.5'
run: sudo apt update && sudo apt install -y rename && rename 's/dev/1.5-dev/' /tmp/${{ inputs.LINUX }}/*.${{ inputs.PACKAGE }}
# Push package (single generic step)
- name: Push package to packagecloud
uses: danielmundi/upload-packagecloud@46cd0e61152bf952dbc0d1759e609d3d22649030 # v1
with:
PACKAGE-NAME: /tmp/${{ inputs.LINUX }}/*.${{ inputs.PACKAGE }}
PACKAGECLOUD-USERNAME: bunkerity
PACKAGECLOUD-REPO: ${{ inputs.REPO }}
PACKAGECLOUD-DISTRIB: ${{ env.DIST }}
PACKAGECLOUD-TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}