Prepare independent CLI builds and immutable Gitea release assets

This commit is contained in:
Anya Tokugawa committed 2026-11-06 02:21:28 +09:00
1 parent d3f4e668c4
commit e4fb4f309f
15 files changed
+396 -4

No files matched your search

+59
View File
@@ -0,0 +1,59 @@
name: Test and release pages-cli
on:
push:
branches: [main]
tags: ['v*']
workflow_dispatch:
jobs:
linux:
runs-on: ${{ vars.IMAGE_RUNNER_LABEL || 'ubuntu-latest' }}
container:
image: docker.gitea.com/runner-images:ubuntu-latest@sha256:fd911d7417bfbf0f454530e447da95b58001e1df41bbc5e1a8dd35d432575aae
env:
PATH: /opt/acttoolcache/node/24.19.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: ${{ github.sha }}
persist-credentials: false
- name: Build native Linux amd64 artifacts and test
env:
SOURCE_REVISION: ${{ github.sha }}
run: docker buildx build --platform linux/amd64 --build-arg SOURCE_REVISION="$SOURCE_REVISION" --file Dockerfile.release --output type=local,dest=release .
- name: Publish release assets
if: startsWith(github.ref, 'refs/tags/v')
env:
GITEA_TOKEN: ${{ secrets.CLI_RELEASE_TOKEN || github.token }}
GITEA_SERVER_URL: ${{ github.server_url }}
GITEA_REPOSITORY: ${{ github.repository }}
GITEA_REF: ${{ github.ref }}
GITEA_SHA: ${{ github.sha }}
run: python3 tools/publish.py
macos:
needs: linux
if: vars.CLI_MACOS_ENABLED == 'true'
runs-on: ${{ vars.CLI_MACOS_RUNNER_LABEL || 'pages-cli-macos' }}
steps:
- uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: ${{ github.sha }}
persist-credentials: false
- name: Native macOS build
env:
SOURCE_REVISION: ${{ github.sha }}
run: |
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements-build.txt
python -m unittest test_pages test_productivity test_distribution
python tools/build.py
python tools/smoke_binary.py dist/pages
- name: Publish release assets
if: startsWith(github.ref, 'refs/tags/v')
env:
GITEA_TOKEN: ${{ secrets.CLI_RELEASE_TOKEN || github.token }}
GITEA_SERVER_URL: ${{ github.server_url }}
GITEA_REPOSITORY: ${{ github.repository }}
GITEA_REF: ${{ github.ref }}
GITEA_SHA: ${{ github.sha }}
run: .venv/bin/python tools/publish.py