ci: simplify Gitea runner E2E workflow trigger
Some checks failed
Gitea Runner E2E Publish / publish (push) Failing after 39s
Some checks failed
Gitea Runner E2E Publish / publish (push) Failing after 39s
This commit is contained in:
parent
28b9767cb5
commit
5f43c0f5b5
@ -1,45 +1,29 @@
|
|||||||
name: Gitea Runner E2E — publish + integrity check
|
name: Gitea Runner E2E Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: Test version to publish
|
|
||||||
required: true
|
|
||||||
default: 0.0.1-e2e.1
|
|
||||||
push:
|
push:
|
||||||
branches: [runner/gitea-e2e]
|
branches: [runner/gitea-e2e]
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: runner-e2e-publish-${{ github.ref }}
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: [ubuntu-latest, bytelyst, hostinger]
|
runs-on: [ubuntu-latest, bytelyst, hostinger]
|
||||||
timeout-minutes: 15
|
|
||||||
container:
|
container:
|
||||||
image: node:20-bookworm
|
image: node:20-bookworm
|
||||||
options: -v /home/gitea-runner/.gitea_npm_token:/run/secrets/gitea_npm_token:ro
|
options: -v /home/gitea-runner/.gitea_npm_token:/run/secrets/gitea_npm_token:ro
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
run: |
|
run: |
|
||||||
npm install -g pnpm@9.12.0
|
npm install -g pnpm@9.12.0
|
||||||
pnpm --version
|
pnpm --version
|
||||||
|
|
||||||
- name: Set test version
|
- name: Set test version
|
||||||
working-directory: packages/_runner-e2e-test
|
working-directory: packages/_runner-e2e-test
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ github.event.inputs.version }}"
|
VERSION="0.0.1-e2e.1"
|
||||||
if [ -z "$VERSION" ]; then VERSION="0.0.1-e2e.1"; fi
|
|
||||||
echo "TEST_VERSION=$VERSION" >> "$GITHUB_ENV"
|
echo "TEST_VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||||
npm version "$VERSION" --no-git-tag-version --allow-same-version
|
npm version "$VERSION" --no-git-tag-version --allow-same-version
|
||||||
node -p "require('./package.json').version"
|
node -p "require('./package.json').version"
|
||||||
|
|
||||||
- name: Configure registry .npmrc
|
- name: Configure registry .npmrc
|
||||||
working-directory: packages/_runner-e2e-test
|
working-directory: packages/_runner-e2e-test
|
||||||
run: |
|
run: |
|
||||||
@ -48,13 +32,10 @@ jobs:
|
|||||||
@bytelyst:registry=https://gitea.bytelyst.com/api/packages/bytelyst/npm/
|
@bytelyst:registry=https://gitea.bytelyst.com/api/packages/bytelyst/npm/
|
||||||
//gitea.bytelyst.com/api/packages/bytelyst/npm/:_authToken=$TOKEN
|
//gitea.bytelyst.com/api/packages/bytelyst/npm/:_authToken=$TOKEN
|
||||||
NPMRC
|
NPMRC
|
||||||
echo ".npmrc (token masked):"
|
|
||||||
sed 's|_authToken=.*|_authToken=***|' .npmrc
|
sed 's|_authToken=.*|_authToken=***|' .npmrc
|
||||||
|
|
||||||
- name: Publish to Hostinger Gitea
|
- name: Publish to Hostinger Gitea
|
||||||
working-directory: packages/_runner-e2e-test
|
working-directory: packages/_runner-e2e-test
|
||||||
run: pnpm publish --no-git-checks --registry https://gitea.bytelyst.com/api/packages/bytelyst/npm/
|
run: pnpm publish --no-git-checks --registry https://gitea.bytelyst.com/api/packages/bytelyst/npm/
|
||||||
|
|
||||||
- name: Verify package returned by Gitea
|
- name: Verify package returned by Gitea
|
||||||
run: |
|
run: |
|
||||||
TOKEN=$(tr -d '\n' < /run/secrets/gitea_npm_token)
|
TOKEN=$(tr -d '\n' < /run/secrets/gitea_npm_token)
|
||||||
@ -62,8 +43,7 @@ jobs:
|
|||||||
printf '%s' "$RESP" | python3 -c 'import json,sys; data=json.load(sys.stdin); print("package:", data.get("name")); print("versions:", ",".join(sorted(data.get("versions", {}).keys())))'
|
printf '%s' "$RESP" | python3 -c 'import json,sys; data=json.load(sys.stdin); print("package:", data.get("name")); print("versions:", ",".join(sorted(data.get("versions", {}).keys())))'
|
||||||
echo "$RESP" | grep -q "\"$TEST_VERSION\"" || { echo "FAIL: version missing from Gitea"; exit 1; }
|
echo "$RESP" | grep -q "\"$TEST_VERSION\"" || { echo "FAIL: version missing from Gitea"; exit 1; }
|
||||||
echo "PASS: version in Gitea"
|
echo "PASS: version in Gitea"
|
||||||
|
- name: Verify pnpm install and require works
|
||||||
- name: Verify pnpm install + require works from a clean dir
|
|
||||||
run: |
|
run: |
|
||||||
TOKEN=$(tr -d '\n' < /run/secrets/gitea_npm_token)
|
TOKEN=$(tr -d '\n' < /run/secrets/gitea_npm_token)
|
||||||
mkdir -p /tmp/runner-e2e-consumer && cd /tmp/runner-e2e-consumer
|
mkdir -p /tmp/runner-e2e-consumer && cd /tmp/runner-e2e-consumer
|
||||||
@ -77,7 +57,6 @@ jobs:
|
|||||||
pnpm install --no-frozen-lockfile
|
pnpm install --no-frozen-lockfile
|
||||||
node -e "const m=require('@bytelyst/_runner-e2e-test'); console.log(m); process.exit(m.ok?0:1);"
|
node -e "const m=require('@bytelyst/_runner-e2e-test'); console.log(m); process.exit(m.ok?0:1);"
|
||||||
echo "PASS: install + require works"
|
echo "PASS: install + require works"
|
||||||
|
|
||||||
- name: Verify local pack matches Gitea stored tarball shasum
|
- name: Verify local pack matches Gitea stored tarball shasum
|
||||||
working-directory: packages/_runner-e2e-test
|
working-directory: packages/_runner-e2e-test
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user