Skip to content

Commit cb5d1e3

Browse files
committed
[Update] release workflow
1 parent 35849b0 commit cb5d1e3

2 files changed

Lines changed: 6 additions & 49 deletions

File tree

.github/workflows/build.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build
22

33
on:
44
release:
5-
types: [created]
5+
types: [published]
66

77
permissions:
88
contents: write
@@ -89,16 +89,10 @@ jobs:
8989
with:
9090
path: artifacts
9191

92-
- name: Get latest release tag
93-
id: get_tag
94-
run: |
95-
TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
96-
echo "tag=$TAG" >> $GITHUB_OUTPUT
97-
9892
- name: Upload to release
9993
uses: softprops/action-gh-release@v1
10094
with:
101-
tag_name: ${{ steps.get_tag.outputs.tag }}
95+
tag_name: ${{ github.event.release.tag_name }}
10296
files: |
10397
artifacts/linux-x86_64_generator/*
10498
artifacts/linux-aarch64_generator/*

.github/workflows/release.yml

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Release
22

33
on:
44
push:
5-
paths: project.toml
5+
tags:
6+
- "v*"
67

78
permissions:
89
contents: write
@@ -13,48 +14,11 @@ jobs:
1314
steps:
1415
- name: Checkout
1516
uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
ref: ${{ github.ref }}
19-
20-
- name: Setup python
21-
uses: actions/setup-python@v5
22-
with:
23-
python-version: "3.11"
24-
25-
- name: Read version from project config
26-
id: read_toml
27-
uses: SebRollen/toml-action@v1.0.2
28-
with:
29-
file: project.toml
30-
field: project.version
31-
32-
# - name: Replace template
33-
# run: python3 scripts/replace-template.py
34-
35-
# - name: Commit changes
36-
# uses: EndBug/add-and-commit@v7
37-
# with:
38-
# message: "[Release] ${{ steps.read_toml.outputs.value }}"
39-
# pull_strategy: "NO-PULL"
40-
# push: false
41-
#
42-
# - name: Push changes
43-
# run: |
44-
# git pull --rebase
45-
# git push
46-
47-
- name: Bump version and push tag
48-
id: tag_version
49-
uses: mathieudutour/github-tag-action@v6.1
50-
with:
51-
github_token: ${{ secrets.PAT }}
52-
custom_tag: ${{ steps.read_toml.outputs.value }}
5317

5418
- name: Check if the tag is prerelease tag
5519
id: is_prerelease
5620
run: |
57-
if [[ "${{ steps.read_toml.outputs.value }}" == *"-"* ]]; then
21+
if [[ "${{ github.ref_name }}" == *"-"* ]]; then
5822
echo "is_prerelease=true" >> $GITHUB_ENV
5923
else
6024
echo "is_prerelease=false" >> $GITHUB_ENV
@@ -63,8 +27,7 @@ jobs:
6327
- name: Create a GitHub release
6428
uses: ncipollo/release-action@v1
6529
with:
66-
tag: ${{ steps.tag_version.outputs.new_tag }}
67-
name: Release ${{ steps.tag_version.outputs.new_tag }}
30+
name: Release ${{ github.ref_name }}
6831
token: ${{ secrets.PAT }}
6932
generateReleaseNotes: true
7033
prerelease: ${{ env.is_prerelease }}

0 commit comments

Comments
 (0)