Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 21 additions & 8 deletions .github/workflows/ipollo-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ on:
release_tag:
description: Complete numeric draft release, for example v1.0.3
required: true
mirror:
description: Also dispatch synchronization to configured mainland storage
type: boolean
default: false
promote_preview:
description: Promote an existing public preview after every platform has qualified
type: boolean
default: false

permissions:
id-token: write
contents: write
actions: write

Expand All @@ -26,7 +23,8 @@ concurrency:
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 30
environment: release-mirror
timeout-minutes: 90
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
Expand All @@ -37,6 +35,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '24.22.3'
- name: Obtain temporary OSS credentials through GitHub OIDC
uses: aliyun/configure-aliyun-credentials-action@1e5248c8d5d93a8781ac344a68e19a43341e79e6
with:
role-to-assume: acs:ram::1369978658055461:role/ipollowork-release-oss
oidc-provider-arn: acs:ram::1369978658055461:oidc-provider/github-actions-ipollowork
audience: sts.aliyuncs.com
role-session-expiration: 3600
role-session-name: ipollowork-release-${{ github.run_id }}
- name: Require a numeric draft and a version newer than Latest
env:
PROMOTE_PREVIEW: ${{ inputs.promote_preview }}
Expand All @@ -57,18 +63,25 @@ jobs:
version="${RELEASE_TAG#v}"
gh release upload "$RELEASE_TAG" release-assets/stable-mac.yml release-assets/stable.yml release-assets/IPOLLO-SHA256SUMS.txt \
"release-assets/ipollowork-win-x64-$version.exe" release-assets/ipollowork-*-latest.* --clobber
- name: Install CI-only OSS transport
working-directory: integrations/tooling/oss
run: npm ci --ignore-scripts --registry=https://registry.npmjs.org
- name: Require verified copies in both website OSS buckets
run: |
release_api=$(gh release view "$RELEASE_TAG" --json apiUrl --jq .apiUrl)
gh api "$release_api" > mirror-release.json
node integrations/tooling/release-oss.mjs stage mirror-release.json release-assets
- name: Publish Latest
id: publish-latest
run: gh release edit "$RELEASE_TAG" --draft=false --prerelease=false --latest
- name: Verify public update feeds and every referenced download
run: node integrations/tooling/release-publication.mjs verify release.json "https://github.com/$GITHUB_REPOSITORY/releases/latest/download/" release-assets
- name: Activate verified website downloads in both regions
run: node integrations/tooling/release-oss.mjs activate mirror-release.json release-assets
- name: Restore the previous Latest if public verification fails
if: failure() && steps.publish-latest.outcome == 'success'
run: |
if test -f previous-release.json; then
previous=$(node -p 'JSON.parse(require("fs").readFileSync("previous-release.json", "utf8")).tag_name')
gh release edit "$previous" --latest
fi
- name: Synchronize exact release bytes to the mainland mirror
if: inputs.mirror
run: gh workflow run release-mirror.yml --ref main -f "release_tag=$RELEASE_TAG" -f publish_draft=false
21 changes: 20 additions & 1 deletion .github/workflows/ipollo-repair-downloads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
description: Existing Latest release whose verified payloads need website aliases
required: true
permissions:
id-token: write
contents: write
concurrency:
group: ipollo-publish
cancel-in-progress: false
jobs:
repair:
runs-on: ubuntu-latest
timeout-minutes: 20
environment: release-mirror
timeout-minutes: 90
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
Expand All @@ -22,6 +24,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '24.22.3'
- name: Obtain temporary OSS credentials through GitHub OIDC
uses: aliyun/configure-aliyun-credentials-action@1e5248c8d5d93a8781ac344a68e19a43341e79e6
with:
role-to-assume: acs:ram::1369978658055461:role/ipollowork-release-oss
oidc-provider-arn: acs:ram::1369978658055461:oidc-provider/github-actions-ipollowork
audience: sts.aliyuncs.com
role-session-expiration: 3600
role-session-name: ipollowork-release-${{ github.run_id }}
- name: Verify the current public release and original payloads
run: |
set -euo pipefail
Expand All @@ -36,3 +46,12 @@ jobs:
gh release upload "$RELEASE_TAG" "release-assets/ipollowork-win-x64-$version.exe" release-assets/ipollowork-*-latest.* release-assets/IPOLLO-SHA256SUMS.txt --clobber
- name: Verify the actual public download URLs
run: node integrations/tooling/release-publication.mjs verify release.json "https://github.com/$GITHUB_REPOSITORY/releases/latest/download/" release-assets
- name: Install CI-only OSS transport
working-directory: integrations/tooling/oss
run: npm ci --ignore-scripts --registry=https://registry.npmjs.org
- name: Refresh both OSS mirrors after repairing aliases
run: |
release_api=$(gh release view "$RELEASE_TAG" --json apiUrl --jq .apiUrl)
gh api "$release_api" > mirror-release.json
node integrations/tooling/release-oss.mjs stage mirror-release.json release-assets
node integrations/tooling/release-oss.mjs activate mirror-release.json release-assets
10 changes: 8 additions & 2 deletions .github/workflows/ipollowork-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: iPolloWork integrations
on:
push:
branches: [main]
paths: ['plugins/ipollo-enterprise/**', 'plugins/ipollowork-suite/**', 'plugins/collaboration-board/**', 'plugins/notification-center/**', 'services/ipollowork/**', 'integrations/**', '.github/workflows/ipollowork-integrations.yml', 'package.json', 'AGENTS.md', 'LICENSE', 'LICENSES/**', 'README*']
paths: ['plugins/ipollo-enterprise/**', 'plugins/ipollowork-suite/**', 'plugins/collaboration-board/**', 'plugins/notification-center/**', 'plugins/doctor-workbench/**', 'plugins/_shared/**', 'services/ipollowork/**', 'integrations/**', '.github/workflows/ipollowork-integrations.yml', 'package.json', 'AGENTS.md', 'LICENSE', 'LICENSES/**', 'README*']
pull_request:
paths: ['plugins/ipollo-enterprise/**', 'plugins/ipollowork-suite/**', 'plugins/collaboration-board/**', 'plugins/notification-center/**', 'services/ipollowork/**', 'integrations/**', '.github/workflows/ipollowork-integrations.yml', 'package.json', 'AGENTS.md', 'LICENSE', 'LICENSES/**', 'README*']
paths: ['plugins/ipollo-enterprise/**', 'plugins/ipollowork-suite/**', 'plugins/collaboration-board/**', 'plugins/notification-center/**', 'plugins/doctor-workbench/**', 'plugins/_shared/**', 'services/ipollowork/**', 'integrations/**', '.github/workflows/ipollowork-integrations.yml', 'package.json', 'AGENTS.md', 'LICENSE', 'LICENSES/**', 'README*']
workflow_dispatch:
permissions:
contents: read
Expand Down Expand Up @@ -38,6 +38,12 @@ jobs:
run: node node_modules/vitest/vitest.mjs run --config integrations/desktop/vitest.config.ts --maxWorkers=2
- name: Check enterprise connector
run: npm run check --prefix plugins/ipollo-enterprise
- name: Check and package Doctor Workbench
working-directory: plugins/doctor-workbench
run: |
npm ci --ignore-scripts --workspaces=false
npm run check --workspaces=false
npm run pack:check --workspaces=false
- name: Install account service dependencies
working-directory: services/ipollowork
run: npm ci --ignore-scripts --workspaces=false
Expand Down
96 changes: 30 additions & 66 deletions .github/workflows/release-mirror.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,57 @@
name: Publish identical global and mainland releases
name: Mirror published releases to both website OSS buckets
on:
release:
types: [published, edited]
workflow_dispatch:
inputs:
release_tag:
description: Fully built release tag (a draft is published only after mirror verification)
description: Existing published numeric release to archive in both regions
required: true
publish_draft:
description: Publish draft after every mirrored asset passes verification
type: boolean
default: true
permissions:
contents: write
id-token: write
contents: read
# Serialize all website-pointer writers with normal release publication.
concurrency:
group: release-mirror-${{ github.event.release.tag_name || inputs.release_tag }}
group: ipollo-publish
cancel-in-progress: false
jobs:
mirror:
if: github.event_name == 'workflow_dispatch' || github.event.release.draft == false
if: github.event_name == 'workflow_dispatch' || (github.event.release.draft == false && github.event.release.prerelease == false)
runs-on: ubuntu-latest
environment: release-mirror
timeout-minutes: 90
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.release_tag }}
MIRROR_ENDPOINT: ${{ vars.IPOLLO_MIRROR_S3_ENDPOINT }}
MIRROR_BUCKET: ${{ vars.IPOLLO_MIRROR_BUCKET }}
MIRROR_PUBLIC_URL: ${{ vars.IPOLLO_MIRROR_PUBLIC_URL }}
AWS_DEFAULT_REGION: ${{ vars.IPOLLO_MIRROR_REGION || 'cn-north-1' }}
AWS_ACCESS_KEY_ID: ${{ secrets.IPOLLO_MIRROR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.IPOLLO_MIRROR_SECRET_ACCESS_KEY }}
AWS_RETRY_MODE: standard
AWS_MAX_ATTEMPTS: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- uses: actions/setup-node@v4
with:
node-version: '24.22.3'
- name: Require configured mainland storage
shell: bash
- name: Obtain temporary OSS credentials through GitHub OIDC
uses: aliyun/configure-aliyun-credentials-action@1e5248c8d5d93a8781ac344a68e19a43341e79e6
with:
role-to-assume: acs:ram::1369978658055461:role/ipollowork-release-oss
oidc-provider-arn: acs:ram::1369978658055461:oidc-provider/github-actions-ipollowork
audience: sts.aliyuncs.com
role-session-expiration: 3600
role-session-name: ipollowork-release-${{ github.run_id }}
- name: Require a public stable release
run: |
set -euo pipefail
: "${MIRROR_ENDPOINT:?Configure IPOLLO_MIRROR_S3_ENDPOINT}"
: "${MIRROR_BUCKET:?Configure IPOLLO_MIRROR_BUCKET}"
: "${MIRROR_PUBLIC_URL:?Configure IPOLLO_MIRROR_PUBLIC_URL}"
: "${AWS_ACCESS_KEY_ID:?Configure IPOLLO_MIRROR_ACCESS_KEY_ID}"
: "${AWS_SECRET_ACCESS_KEY:?Configure IPOLLO_MIRROR_SECRET_ACCESS_KEY}"
- name: Download and verify original GitHub assets
shell: bash
release_api=$(gh release view "$RELEASE_TAG" --json apiUrl --jq .apiUrl)
gh api "$release_api" > mirror-release.json
node --input-type=module -e 'import fs from "node:fs"; import assert from "node:assert/strict"; import {numericReleaseVersion} from "./integrations/tooling/release-update-feed.mjs"; const r=JSON.parse(fs.readFileSync("mirror-release.json")); numericReleaseVersion(r.tag_name); assert.equal(r.draft,false); assert.equal(r.prerelease,false)'
- name: Install CI-only OSS transport
working-directory: integrations/tooling/oss
run: npm ci --ignore-scripts --registry=https://registry.npmjs.org
- name: Use GitHub fallback while a manually published Latest is syncing
run: node integrations/tooling/release-oss.mjs pending mirror-release.json release-assets
- name: Copy and verify all release assets in both regions
run: |
set -euo pipefail
mkdir release-assets
release_api=$(gh release view "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --json apiUrl --jq .apiUrl)
gh api "$release_api" > release.json
gh release download "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --dir release-assets
node integrations/tooling/release-mirror.mjs manifest release.json release-assets
- name: Require upgrade qualification before publishing the mirror
env:
PUBLISH_DRAFT: ${{ inputs.publish_draft }}
run: |
previous=()
if [[ "$PUBLISH_DRAFT" == true ]] && node -e 'process.exit(require("./release.json").draft ? 0 : 1)'; then
gh api "repos/$GITHUB_REPOSITORY/releases/latest" > previous-release.json
previous+=(previous-release.json)
fi
node integrations/tooling/release-publication.mjs qualify release.json release-assets "${previous[@]}"
- name: Configure OSS-compatible addressing
run: aws configure set default.s3.addressing_style virtual
- name: Copy exact bytes to mainland storage
shell: bash
run: |
set -euo pipefail
aws s3 cp release-assets/ "s3://$MIRROR_BUCKET/releases/$RELEASE_TAG/" --recursive --endpoint-url "$MIRROR_ENDPOINT" --only-show-errors --exclude mirror-manifest.json
- name: Verify every asset through the public mirror
shell: bash
run: |
set -euo pipefail
node integrations/tooling/release-mirror.mjs verify release-assets/mirror-manifest.json "$MIRROR_PUBLIC_URL"
- name: Publish verified manifest and optional draft
shell: bash
env:
PUBLISH_DRAFT: ${{ inputs.publish_draft }}
run: |
set -euo pipefail
aws s3 cp release-assets/mirror-manifest.json "s3://$MIRROR_BUCKET/releases/$RELEASE_TAG/mirror-manifest.json" --endpoint-url "$MIRROR_ENDPOINT" --cache-control no-cache --only-show-errors
if [ "$PUBLISH_DRAFT" = true ]; then
gh release edit "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --draft=false
fi
echo "Verified global and mainland release: $RELEASE_TAG" >> "$GITHUB_STEP_SUMMARY"
gh release download "$RELEASE_TAG" --dir release-assets
node integrations/tooling/release-oss.mjs stage mirror-release.json release-assets
- name: Activate only if this release is still GitHub Latest
run: node integrations/tooling/release-oss.mjs activate mirror-release.json release-assets
Loading