forked from tickernelz/opencode-kiro-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (60 loc) · 1.96 KB
/
Copy pathmaster-tarball.yml
File metadata and controls
75 lines (60 loc) · 1.96 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
name: Build and publish tarball
on:
push:
branches:
- master
workflow_dispatch:
jobs:
tarball:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun test
- run: bun run typecheck
- run: bun run build
- name: Stamp version with datetime
run: |
TIMESTAMP=$(date -u +%Y%m%d%H%M%S)
jq --arg v "$(jq -r .version package.json)-dev.${TIMESTAMP}" '.version = $v' package.json > package.tmp && mv package.tmp package.json
- name: Pack tarball
run: npm pack
- name: Rename tarball to fixed name
run: mv *.tgz opencode-kiro-auth.tgz
- name: Check if release exists
id: check_release
run: |
if gh release view "_master" >/dev/null 2>&1; then
echo "release_exists=true" >> $GITHUB_ENV
else
echo "release_exists=false" >> $GITHUB_ENV
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release if missing
if: env.release_exists != 'true'
run: |
gh release create "_master" \
--target master \
--prerelease \
--title "Nightly Build master" \
--notes "Nightly build. Commit: ${{ github.sha }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Ensure _master tag points at HEAD
run: |
git tag -f _master HEAD
git push origin _master --force
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete old tarball asset
run: gh release delete-asset _master opencode-kiro-auth.tgz --yes || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload tarball
run: gh release upload _master opencode-kiro-auth.tgz --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}