Skip to content

Commit 4f77c50

Browse files
committed
[FIX] build workflow
1 parent f857210 commit 4f77c50

1 file changed

Lines changed: 10 additions & 41 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,22 @@ on:
77

88
jobs:
99
build:
10+
name: Create Release
11+
permissions: write-all
1012
runs-on: ubuntu-latest
11-
timeout-minutes: 60
12-
strategy:
13-
matrix:
14-
python-version:
15-
- '3.10'
16-
1713
steps:
18-
- name: Checkout Repository
19-
uses: actions/checkout@v3
20-
with:
21-
fetch-depth: 0
22-
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
- name: Get version from setup.cfg
17+
id: get-version
18+
run: echo "::set-output name=version::$(awk -F "=" '/^version/ {print $2}' setup.cfg | tr -d '[:space:]')"
2319
- name: Create Release
2420
id: create_release
2521
uses: actions/create-release@v1
2622
env:
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
2824
with:
29-
tag_name: ${{ github.ref }}
30-
release_name: Release ${{ github.ref }}
25+
tag_name: v${{ steps.get-version.outputs.version }}
26+
release_name: Release v${{ steps.get-version.outputs.version }}
3127
draft: false
3228
prerelease: ${{ contains(github.ref, '-beta') || contains(github.ref, '-alpha') || contains(github.ref, '-rc') }}
33-
34-
- name: Extract Tag Name
35-
id: get_version
36-
run: echo "VERSION=${GITHUB_REF/refs/tags/}" >> $GITHUB_ENV
37-
38-
- name: Set Up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@v4
40-
with:
41-
python-version: ${{ matrix.python-version }}
42-
43-
- name: Install Dependencies
44-
run: |
45-
python -m pip install --upgrade pip setuptools wheel build
46-
47-
- name: Build Package
48-
run: python -m build
49-
50-
- name: Upload Release Asset
51-
id: upload-release-asset
52-
uses: actions/upload-release-asset@v1
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
with:
56-
upload_url: ${{ steps.create_release.outputs.upload_url }}
57-
asset_path: dist/*
58-
asset_name: package.zip
59-
asset_content_type: application/zip

0 commit comments

Comments
 (0)