Skip to content

Commit 20f4be8

Browse files
committed
Add release workflow and changelog config
1 parent 501fc48 commit 20f4be8

File tree

4 files changed

+112
-3
lines changed

4 files changed

+112
-3
lines changed

.github/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
changelog:
2+
categories:
3+
- title: 🚀 New Features
4+
labels:
5+
- feature
6+
- enhancement
7+
- title: 🐛 Bug Fixes
8+
labels:
9+
- bug
10+
- bugfix
11+
- fix
12+
- title: 📝 Documentation
13+
labels:
14+
- documentation
15+
- docs
16+
- title: 🧹 Maintenance
17+
labels:
18+
- maintenance
19+
- chore
20+
- refactor
21+
- title: 🔧 Dependencies
22+
labels:
23+
- dependencies
24+
- deps
25+
- title: Other Changes
26+
labels:
27+
- "*"
28+
exclude:
29+
labels:
30+
- ignore-for-release
31+
authors:
32+
- dependabot

.github/workflows/release.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
env:
9+
DOCKER_REPO: bobymicroby
10+
DOCKER_IMAGE: resp-proxy
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
packages: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup Bun
25+
uses: oven-sh/setup-bun@v2
26+
with:
27+
bun-version: latest
28+
29+
- name: Install dependencies
30+
run: bun install --frozen-lockfile
31+
32+
- name: Run linter
33+
run: bun run lint
34+
35+
- name: Run tests
36+
run: bun test
37+
38+
- name: Extract version from tag
39+
id: version
40+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
41+
42+
- name: Log in to Docker Hub
43+
run: |
44+
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
45+
46+
- name: Build the Docker image
47+
run: |
48+
docker build -t ${{ env.DOCKER_REPO }}/${{ env.DOCKER_IMAGE }}:latest .
49+
50+
- name: Tag the Docker image
51+
run: |
52+
docker tag ${{ env.DOCKER_REPO }}/${{ env.DOCKER_IMAGE }}:latest ${{ env.DOCKER_REPO }}/${{ env.DOCKER_IMAGE }}:${{ steps.version.outputs.VERSION }}
53+
54+
- name: Push the Docker image to Docker Hub
55+
run: |
56+
docker push ${{ env.DOCKER_REPO }}/${{ env.DOCKER_IMAGE }}:latest
57+
docker push ${{ env.DOCKER_REPO }}/${{ env.DOCKER_IMAGE }}:${{ steps.version.outputs.VERSION }}
58+
59+
- name: Create GitHub Release
60+
uses: actions/create-release@v1
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
with:
64+
tag_name: ${{ github.ref }}
65+
release_name: Release ${{ steps.version.outputs.VERSION }}
66+
body: |
67+
## Docker Image
68+
69+
```bash
70+
docker pull ${{ env.DOCKER_REPO }}/${{ env.DOCKER_IMAGE }}:${{ steps.version.outputs.VERSION }}
71+
```
72+
draft: true
73+
prerelease: false
74+
generate_release_notes: true

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
bun-version: latest
2020

2121
- name: Install dependencies
22-
run: bun install
22+
run: bun install --frozen-lockfile
2323

2424
- name: Run linter
2525
run: bun run lint

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "resp-proxy",
3-
"version": "1.0.0",
3+
"version": "0.1.0",
44
"description": "A Redis RESP protocol proxy server",
55
"author": "Borislav Ivanov <borislav.ivanov@redis.com> (Redis Inc)",
66
"license": "MIT",
@@ -14,7 +14,10 @@
1414
"type-check": "bunx tsc --noEmit",
1515
"lint": "bunx @biomejs/biome check src/",
1616
"lint:fix": "bunx @biomejs/biome check --apply src/",
17-
"format": "bunx @biomejs/biome format --write src/"
17+
"format": "bunx @biomejs/biome format --write src/",
18+
"release:patch": "bun version patch && git push origin master --follow-tags",
19+
"release:minor": "bun version minor && git push origin master --follow-tags",
20+
"release:major": "bun version major && git push origin master --follow-tags"
1821
},
1922
"dependencies": {
2023
"@hono/zod-validator": "^0.7.2",

0 commit comments

Comments
 (0)