Skip to content

Commit 2097b23

Browse files
committed
ci: improve release workflow and remove third-party dependencies
- Replace ncipollo/release-action with official GitHub CLI (gh) - Remove artifact upload/download steps for direct binary uploads - Make build jobs run in parallel with lint (non-blocking) - Rename release.yml to build-release.yml for clarity - Add release-please.yaml with custom token support - Trigger on release published instead of tag pushes
1 parent 4e469cd commit 2097b23

4 files changed

Lines changed: 57 additions & 62 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
1-
name: Build and Release
1+
name: Build and release binaries
22

33
on:
4-
push:
5-
tags:
6-
- "v*.*.*"
4+
release:
5+
types: [published]
76

87
jobs:
9-
build:
10-
name: Compile binaries
8+
lint:
9+
name: Lint and format check
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Deno
16+
uses: denoland/setup-deno@v1
17+
with:
18+
deno-version: v2.x
19+
20+
- name: Check formatting
21+
run: deno fmt --check
22+
23+
- name: Lint code
24+
run: deno lint
25+
26+
- name: Type check
27+
run: deno check src/main.ts
28+
29+
build-and-upload:
30+
name: Build and upload binaries
1131
runs-on: ubuntu-latest
32+
permissions:
33+
contents: write
1234
strategy:
1335
matrix:
1436
include:
@@ -39,36 +61,8 @@ jobs:
3961
--output ${{ matrix.artifact_name }} \
4062
main.ts
4163
42-
- name: Upload artifact
43-
uses: actions/upload-artifact@v4
44-
with:
45-
name: ${{ matrix.artifact_name }}
46-
path: ${{ matrix.artifact_name }}
47-
if-no-files-found: error
48-
49-
release:
50-
name: Create GitHub Release
51-
needs: build
52-
runs-on: ubuntu-latest
53-
permissions:
54-
contents: write
55-
steps:
56-
- name: Download artifacts
57-
uses: actions/download-artifact@v4
58-
with:
59-
path: artifacts
60-
merge-multiple: true
61-
62-
- name: List artifacts
63-
run: ls -la artifacts/
64-
65-
- name: Create Release
66-
uses: ncipollo/release-action@v1
67-
with:
68-
artifacts: "artifacts/*"
69-
token: ${{ secrets.GITHUB_TOKEN }}
70-
tag: ${{ github.ref_name }}
71-
name: Release ${{ github.ref_name }}
72-
draft: false
73-
prerelease: false
74-
generateReleaseNotes: true
64+
- name: Upload binary to release
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
run: |
68+
gh release upload ${{ github.event.release.tag_name }} ${{ matrix.artifact_name }} --clobber

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
branches: [main]
88

99
jobs:
10-
test:
11-
name: Test & Lint
10+
lint:
11+
name: Lint and format check
1212
runs-on: ubuntu-latest
1313

1414
steps:
@@ -30,7 +30,7 @@ jobs:
3030
run: deno check src/main.ts
3131

3232
build:
33-
name: Test Build
33+
name: Test build
3434
runs-on: ubuntu-latest
3535

3636
steps:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
# https://github.com/googleapis/release-please-action
17+
- uses: googleapis/release-please-action@v4
18+
with:
19+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
20+
config-file: .github/release-please-config.json
21+
manifest-file: .github/release-please-manifest.json

.github/workflows/release-please.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)