Skip to content

Commit e0ca060

Browse files
authored
Update FinCLI 1.8.4
1 parent 92ce8cb commit e0ca060

1 file changed

Lines changed: 20 additions & 66 deletions

File tree

.github/workflows/publish.yml

Lines changed: 20 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,32 @@
1-
name: Publish
1+
name: Publish to npm
22

33
on:
4-
push:
5-
tags:
6-
- 'v*'
4+
release:
5+
types: [published] # Berjalan otomatis saat Anda membuat Release baru di GitHub
6+
# Atau jika ingin dijalankan manual lewat tab Actions:
7+
workflow_dispatch:
78

89
jobs:
9-
test:
10-
runs-on: ${{ matrix.os }}
11-
strategy:
12-
matrix:
13-
os: [ubuntu-latest, windows-latest, macos-latest]
14-
python-version: ["3.11", "3.12"]
15-
steps:
16-
- uses: actions/checkout@v4
17-
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
python -m pip install -e ".[dev]"
27-
28-
- name: Compile check
29-
run: python -m compileall fincli -q
30-
31-
- name: Run tests
32-
run: pytest -q
33-
34-
- name: Prepublish scan
35-
run: python scripts/prepublish_check.py --skip-pack
36-
37-
publish-npm:
38-
needs: test
10+
publish:
3911
runs-on: ubuntu-latest
12+
# PENTING: Permission ini wajib ada untuk menggunakan OIDC Trusted Publisher
13+
permissions:
14+
contents: read
15+
id-token: write
16+
4017
steps:
41-
- uses: actions/checkout@v4
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
4220

43-
- name: Set up Node.js
21+
- name: Setup Node.js
4422
uses: actions/setup-node@v4
4523
with:
46-
node-version: "20"
47-
registry-url: "https://registry.npmjs.org"
24+
node-version: '20'
25+
registry-url: 'https://registry.npmjs.org'
4826

49-
- name: npm pack dry-run
50-
run: npm pack --dry-run
27+
- name: Install dependencies
28+
run: npm ci
5129

30+
# Langkah publish menggunakan OIDC (tanpa token)
5231
- name: Publish to npm
53-
run: npm publish --access=public
54-
env:
55-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56-
57-
publish-pypi:
58-
needs: test
59-
runs-on: ubuntu-latest
60-
steps:
61-
- uses: actions/checkout@v4
62-
63-
- name: Set up Python
64-
uses: actions/setup-python@v5
65-
with:
66-
python-version: "3.12"
67-
68-
- name: Install build tools
69-
run: python -m pip install --upgrade pip build twine
70-
71-
- name: Build package
72-
run: python -m build
73-
74-
- name: Publish to PyPI
75-
run: python -m twine upload dist/*
76-
env:
77-
TWINE_USERNAME: __token__
78-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
32+
run: npm publish --provenance

0 commit comments

Comments
 (0)