mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-07-28 07:08:48 +02:00
64e8a03be2
Bumps the github-actions group with 3 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [docker/login-action](https://github.com/docker/login-action) and [anomalyco/opencode/github](https://github.com/anomalyco/opencode). Updates `actions/checkout` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1) Updates `docker/login-action` from 4.4.0 to 4.5.1 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/af1e73f918a031802d376d3c8bbc3fe56130a9b0...abd2ef45e78c5afb21d64d4ca52ee8550d9572c7) Updates `anomalyco/opencode/github` from 1.18.3 to 1.18.5 - [Release notes](https://github.com/anomalyco/opencode/releases) - [Commits](https://github.com/anomalyco/opencode/compare/127bdb30784d508cc556c71a0f32b508a3061517...e5cc278dec9294a627a7b05f47ce6a564408c1a2) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: anomalyco/opencode/github dependency-version: 1.18.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: docker/login-action dependency-version: 4.5.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
78 lines
2.9 KiB
YAML
78 lines
2.9 KiB
YAML
name: Publish Linux Repos
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Release tag (e.g. v0.18.1). Leave empty for latest."
|
|
required: false
|
|
type: string
|
|
workflow_run:
|
|
workflows: ["Release"]
|
|
types:
|
|
- completed
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
publish-repos:
|
|
if: >
|
|
github.repository == 'zhom/donutbrowser' &&
|
|
(github.event_name == 'workflow_dispatch' ||
|
|
github.event.workflow_run.conclusion == 'success')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
|
|
|
|
- name: Determine release tag
|
|
id: tag
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
INPUT_TAG: ${{ inputs.tag }}
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
WORKFLOW_HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
|
|
REPOSITORY: ${{ github.repository }}
|
|
run: |
|
|
if [[ -n "${INPUT_TAG:-}" ]]; then
|
|
TAG="$INPUT_TAG"
|
|
elif [[ "$EVENT_NAME" == "workflow_run" ]]; then
|
|
# The Release workflow is triggered by a tag push (v*),
|
|
# so head_branch is the tag name
|
|
TAG="$WORKFLOW_HEAD_BRANCH"
|
|
else
|
|
TAG=$(gh release view --repo "$REPOSITORY" --json tagName -q .tagName)
|
|
fi
|
|
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "Invalid release tag" >&2
|
|
exit 1
|
|
fi
|
|
printf 'tag=%s\n' "$TAG" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Install tools
|
|
run: |
|
|
# Mirror the local/Docker setup from CLAUDE.md exactly: the same apt
|
|
# packages and the same pip-installed awscli the working local run uses.
|
|
sudo apt-get update
|
|
sudo apt-get install -y dpkg-dev createrepo-c python3-pip
|
|
pip3 install --break-system-packages awscli
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Publish DEB & RPM repositories to R2
|
|
env:
|
|
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
R2_ENDPOINT_URL: ${{ secrets.R2_ENDPOINT_URL }}
|
|
R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME }}
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
RELEASE_TAG: ${{ steps.tag.outputs.tag }}
|
|
run: |
|
|
# Normalize accidental quotes and whitespace in configured secrets.
|
|
strip() { printf '%s' "$1" | tr -d '\r\n' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e 's/^"\(.*\)"$/\1/' -e "s/^'\(.*\)'\$/\1/"; }
|
|
export R2_ACCESS_KEY_ID="$(strip "$R2_ACCESS_KEY_ID")"
|
|
export R2_SECRET_ACCESS_KEY="$(strip "$R2_SECRET_ACCESS_KEY")"
|
|
export R2_ENDPOINT_URL="$(strip "$R2_ENDPOINT_URL")"
|
|
export R2_BUCKET_NAME="$(strip "$R2_BUCKET_NAME")"
|
|
bash scripts/publish-repo.sh "$RELEASE_TAG"
|