Skip to content

Commit

Permalink
feat: release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KawaiiZapic committed May 10, 2024
1 parent 08ca806 commit d219beb
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: release
run-name: Release ${{ github.ref_name }}
on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
lfs: true

- uses: pnpm/action-setup@v3
with:
version: 8

- uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Type check
run: pnpm type-check

- name: Build
run: pnpm build

- name: Rename dist
run: mv dist Matecho

- name: Packing
uses: montudor/action-zip@v1
with:
args: zip -qq -D -r Matecho-${{ github.ref_name }}.zip Matecho

- name: Release
uses: softprops/action-gh-release@v2
with:
files: Matecho-${{ github.ref_name }}.zip
generate_release_notes: true
make_latest: true
draft: true
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default defineConfig(async env => {
COMMIT_ID = id.substring(0, 7);
try {
const tag = fs
.readFileSync(__dirname + "/.git/refs/tags/" + packageJson.version)
.readFileSync(__dirname + "/.git/refs/tags/v" + packageJson.version)
.toString("utf-8")
.trim();
if (tag == id) COMMIT_ID = packageJson.version;
Expand Down

0 comments on commit d219beb

Please sign in to comment.