Skip to content

Commit 9ce8948

Browse files
committed
ci: add server and lib release
1 parent 6c1c7bc commit 9ce8948

File tree

3 files changed

+167
-1
lines changed

3 files changed

+167
-1
lines changed

.github/workflows/lib.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "lib-*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout sources
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "20"
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: 8
24+
25+
- name: Install dependencies
26+
run: pnpm i
27+
working-directory: lib
28+
29+
- name: Build
30+
run: pnpm run tsc
31+
working-directory: lib
32+
33+
- name: Publish
34+
uses: JS-DevTools/npm-publish@v3
35+
working-directory: lib
36+
with:
37+
token: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "server-*"
7+
8+
jobs:
9+
check:
10+
name: check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Install toolchain
14+
uses: actions-rs/toolchain@v1
15+
with:
16+
toolchain: nightly
17+
override: true
18+
19+
- name: Checkout Sources
20+
uses: actions/checkout@v4
21+
22+
- name: Install Protoc
23+
uses: arduino/setup-protoc@v3
24+
with:
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Setup cache
28+
uses: Swatinem/rust-cache@v2
29+
30+
- name: Install cargo-make
31+
uses: actions-rs/cargo@v1
32+
with:
33+
command: install
34+
args: cargo-make
35+
36+
- name: Run check
37+
run: cargo make check
38+
39+
clippy:
40+
name: clippy
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Install toolchain
44+
uses: actions-rs/toolchain@v1
45+
with:
46+
toolchain: nightly
47+
override: true
48+
components: clippy
49+
profile: minimal
50+
51+
- name: Checkout Sources
52+
uses: actions/checkout@v4
53+
54+
- name: Install Protoc
55+
uses: arduino/setup-protoc@v3
56+
with:
57+
repo-token: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Setup cache
60+
uses: Swatinem/rust-cache@v2
61+
62+
- name: Install cargo-make
63+
uses: actions-rs/cargo@v1
64+
with:
65+
command: install
66+
args: cargo-make
67+
68+
- name: Run clippy
69+
run: cargo make clippy
70+
71+
tests:
72+
name: tests
73+
runs-on: ubuntu-latest
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
test: [postgres, mysql, mariadb, mssql, unittest]
78+
steps:
79+
- name: Install toolchain
80+
uses: actions-rs/toolchain@v1
81+
with:
82+
toolchain: nightly
83+
override: true
84+
profile: minimal
85+
86+
- name: Checkout Sources
87+
uses: actions/checkout@v4
88+
89+
- name: Install Protoc
90+
uses: arduino/setup-protoc@v3
91+
with:
92+
repo-token: ${{ secrets.GITHUB_TOKEN }}
93+
94+
- name: Setup cache
95+
uses: Swatinem/rust-cache@v2
96+
97+
- name: Install cargo-make
98+
uses: actions-rs/cargo@v1
99+
with:
100+
command: install
101+
args: cargo-make
102+
103+
- name: Tests
104+
run: cargo make ${{ matrix.test }}
105+
106+
docker:
107+
needs: [tests, clippy, check]
108+
name: docker
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Checkout Sources
112+
uses: actions/checkout@v4
113+
114+
- name: Extract version
115+
run: echo "VERSION=${GITHUB_REF#refs/tags/server-}" >> $GITHUB_ENV
116+
117+
- name: Login into repository
118+
uses: docker/login-action@v3
119+
with:
120+
registry: ghcr.io
121+
username: ${{ github.actor }}
122+
password: ${{ secrets.GITHUB_TOKEN }}
123+
124+
- name: Build and push Docker image
125+
uses: docker/build-push-action@v6
126+
with:
127+
context: .
128+
push: true
129+
tags: ghcr.io/onelitefeathernet/feedback-fusion:${env.VERSION},ghcr.io/onelitefeathernet/feedback-fusion:latest

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Webcomponent feedback-fusion following open-wc recommendations",
44
"license": "MIT",
55
"author": "OneLiteFeatherNet",
6-
"version": "0.0.0",
6+
"version": "0.1.0",
77
"type": "module",
88
"main": "dist/src/index.js",
99
"module": "dist/src/index.js",

0 commit comments

Comments
 (0)