Skip to content

Commit 9c86bdf

Browse files
committed
Update workflow
1 parent 8c1f2de commit 9c86bdf

File tree

6 files changed

+319
-89
lines changed

6 files changed

+319
-89
lines changed

.github/actions/env.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import * as fs from 'fs/promises'
2+
import path from 'path'
3+
import { fileURLToPath } from 'url'
4+
5+
declare global {
6+
namespace NodeJS {
7+
interface ProcessEnv {
8+
CLIENT_SECRET: string
9+
CLIENT_ID: string
10+
}
11+
}
12+
}
13+
14+
const secret = process.env.CLIENT_SECRET
15+
const id = process.env.CLIENT_ID
16+
const dirname = path.dirname(fileURLToPath(import.meta.url))
17+
const filePath = path.join(dirname, '..', '..', '.env.bruh')
18+
19+
const envFileContent = `\
20+
VITE_CLIENT_SECRET=${secret}
21+
VITE_CLIENT_ID=${id}
22+
`
23+
24+
async function run() {
25+
await fs.writeFile(filePath, envFileContent, 'utf-8')
26+
}
27+
28+
run()

.github/workflows/release.yml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,23 @@ jobs:
2222
with:
2323
node-version: '16'
2424

25-
- name: Check version changes
26-
uses: EndBug/version-check@v1
27-
id: check
28-
with:
29-
token: ${{ secrets.GITHUB_TOKEN }}
30-
31-
32-
- name: Setup | Rust
33-
if: steps.check.outputs.changed == 'true'
34-
uses: ATiltedTree/setup-rust@v1
35-
with:
36-
rust-version: 1.67.0
37-
3825
- uses: pnpm/action-setup@v2
39-
if: steps.check.outputs.changed == 'true'
4026
name: Install pnpm
41-
id: pnpm-install
4227
with:
4328
version: latest
29+
30+
- name: Create ENV
31+
run: pnpx tsx .github/actions/env.ts
32+
4433

45-
- name: Install tsx
46-
if: steps.check.outputs.changed == 'true'
47-
run: pnpm install tsx
34+
- name: install Rust stable
35+
uses: dtolnay/rust-toolchain@stable
4836

49-
- name: Run file
50-
if: steps.check.outputs.changed == 'true'
51-
run: pnpx tsx ./actions/release.ts
37+
- uses: tauri-apps/tauri-action@v0
5238
env:
5339
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
55-
- name: Publish package to NPM
56-
if: steps.check.outputs.changed == 'true'
57-
run: npm publish
58-
env:
59-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
with:
41+
tagName: gitification-v__VERSION__
42+
releaseName: 'Gitification v__VERSION__'
43+
prerelease: false
44+
args: --target universal-apple-darwin

actions/release.ts

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"eslint": "^8.32.0",
3434
"npm-run-all": "^4.1.5",
3535
"sass": "^1.57.1",
36+
"tsx": "^3.12.3",
3637
"typescript": "^4.6.4",
3738
"unplugin-icons": "^0.15.2",
3839
"vite": "^4.0.0",

0 commit comments

Comments
 (0)