File tree Expand file tree Collapse file tree 1 file changed +34
-4
lines changed Expand file tree Collapse file tree 1 file changed +34
-4
lines changed Original file line number Diff line number Diff line change 7272 name : Create Release
7373 needs : build
7474 runs-on : ubuntu-latest
75- if : github.event_name == 'release' || github.event_name == 'workflow_dispatch'
75+ if : github.event_name == 'release' || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
7676
7777 steps :
78+ - name : Checkout code
79+ uses : actions/checkout@v4
80+
7881 - name : Download all artifacts
7982 uses : actions/download-artifact@v4
8083 with :
@@ -96,11 +99,38 @@ jobs:
9699 cd ..
97100 done
98101
99- - name : Upload release assets
102+ - name : Get version from Cargo.toml
103+ id : version
104+ run : |
105+ VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
106+ echo "version=$VERSION" >> $GITHUB_OUTPUT
107+ echo "tag=v$VERSION" >> $GITHUB_OUTPUT
108+
109+ - name : Upload release assets (for existing releases)
110+ if : github.event_name == 'release'
111+ uses : softprops/action-gh-release@v1
112+ with :
113+ files : |
114+ artifacts/*.zip
115+ artifacts/*.tar.gz
116+
117+ - name : Create or update release (for push/manual trigger)
118+ if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
100119 uses : softprops/action-gh-release@v1
101120 with :
121+ tag_name : ${{ steps.version.outputs.tag }}
122+ name : Release ${{ steps.version.outputs.version }}
123+ body : |
124+ Automated release for version ${{ steps.version.outputs.version }}
125+
126+ ## Changes
127+ - Built from commit ${{ github.sha }}
128+
129+ ## Downloads
130+ - **Linux**: externkit-linux-x86_64.tar.gz
131+ - **Windows**: externkit-windows-x86_64.exe.zip
102132 files : |
103133 artifacts/*.zip
104134 artifacts/*.tar.gz
105- env :
106- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
135+ draft : false
136+ prerelease : false
You can’t perform that action at this time.
0 commit comments