1010 pre-commit :
1111 runs-on : ubuntu-latest
1212 steps :
13- - uses : actions/checkout@v2
13+ - &Checkout
14+ name : Checkout
15+ uses : actions/checkout@v5
16+ with :
17+ fetch-depth : 0
1418
1519 - uses : actions/setup-python@v2
1620 with :
@@ -48,39 +52,40 @@ jobs:
4852 shell : bash
4953
5054 steps :
51- - name : Checkout
52- uses : actions/checkout@v2
55+ - *Checkout
5356
54- - name : Set up Python ${{ matrix.python-version }}
55- uses : actions/setup-python@v2
56- with :
57- python-version : ${{ matrix.python-version }}
57+ - name : Set up Python ${{ matrix.python-version }}
58+ uses : actions/setup-python@v2
59+ with :
60+ python-version : ${{ matrix.python-version }}
5861
59- - name : Install and Run Tests
60- run : |
61- pip install .
62- pip install -r tests/requirements.txt
63- pytest -s ./tests
62+ - name : Install and Run Tests
63+ run : |
64+ pip install .
65+ pip install -r tests/requirements.txt
66+ pytest -s ./tests
6467
6568 test-npm-build :
6669 runs-on : ubuntu-latest
6770
6871 steps :
69- - name : Checkout
70- uses : actions/checkout@v2
72+ - *Checkout
7173
72- - name : Set Up Node
74+ - &SetUpNode
75+ name : Set Up Node
7376 uses : actions/setup-node@v3
7477 with :
7578 node-version : 22
7679
77- - name : Build Vue2 Components
80+ - &BuildVue2Components
81+ name : Build Vue2 Components
7882 run : |
7983 cd vue2-components
8084 npm ci
8185 npm run build
8286
83- - name : Build Vue3 Components
87+ - &BuildVue3Components
88+ name : Build Vue3 Components
8489 run : |
8590 cd vue3-components
8691 npm ci
@@ -90,33 +95,28 @@ jobs:
9095 needs : [pre-commit, pytest, test-npm-build]
9196 runs-on : ubuntu-latest
9297 if : github.event_name == 'push'
98+ environment :
99+ name : pypi
100+ url : https://pypi.org/p/trame-simput
101+ permissions :
102+ id-token : write # IMPORTANT: mandatory for trusted publishing
103+ contents : write # IMPORTANT: mandatory for making GitHub Releases
93104
94105 steps :
95- - name : Checkout
96- uses : actions/checkout@v2
97- with :
98- fetch-depth : 0
106+ - *Checkout
99107
100- - name : Set Up Node
101- uses : actions/setup-node@v3
102- with :
103- node-version : 22
108+ - *SetUpNode
104109
105- - name : Build Vue2 Components
106- run : |
107- cd vue2-components
108- npm ci
109- npm run build
110+ - *BuildVue2Components
110111
111- - name : Build Vue3 Components
112- run : |
113- cd vue3-components
114- npm ci
115- npm run build
112+ - *BuildVue3Components
116113
117114 - name : Python Semantic Release
118- 115+ id : release
116+ 119117 with :
120118 github_token : ${{ secrets.GITHUB_TOKEN }}
121- repository_username : __token__
122- repository_password : ${{ secrets.PYPI_API_TOKEN }}
119+
120+ - name : Publish package distributions to PyPI
121+ if : steps.release.outputs.released == 'true'
122+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments