forked from NoeFabris/opencode-antigravity-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 2.48 KB
/
Copy pathupdate-dist-tag.yml
File metadata and controls
81 lines (70 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Update NPM Dist Tag
on:
workflow_dispatch:
inputs:
version:
description: 'Version to tag (e.g., 1.2.5)'
required: true
type: string
tag:
description: 'Dist tag to update (e.g., latest, beta)'
required: true
type: choice
options:
- latest
- beta
- next
- canary
permissions:
contents: read
id-token: write
jobs:
update-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
always-auth: true
- name: Validate version exists
run: |
set -euo pipefail
VERSION="${{ github.event.inputs.version }}"
TAG="${{ github.event.inputs.tag }}"
echo "Checking if version $VERSION exists on npm..."
if ! npm view opencode-antigravity-auth@$VERSION version >/dev/null 2>&1; then
echo "ERROR: Version $VERSION does not exist on npm" >&2
echo "Available versions:" >&2
npm view opencode-antigravity-auth versions --json | tail -20 >&2
exit 1
fi
echo "Version $VERSION exists on npm"
echo "Current dist-tags:"
npm dist-tag ls opencode-antigravity-auth
- name: Update dist-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
set -euo pipefail
VERSION="${{ github.event.inputs.version }}"
TAG="${{ github.event.inputs.tag }}"
echo "Updating @$TAG tag to version $VERSION..."
npm dist-tag add opencode-antigravity-auth@$VERSION $TAG
echo ""
echo "Updated dist-tags:"
npm dist-tag ls opencode-antigravity-auth
- name: Summary
run: |
echo "## NPM Dist Tag Updated! 🏷️" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Version:** ${{ github.event.inputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "**Tag:** @${{ github.event.inputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Users can now install with:" >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo "npm install opencode-antigravity-auth@${{ github.event.inputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY