Skip to content

Commit 8bd25ea

Browse files
committed
update gh action
1 parent bddca94 commit 8bd25ea

File tree

1 file changed

+17
-66
lines changed

1 file changed

+17
-66
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -12,89 +12,40 @@ jobs:
1212
strategy:
1313
matrix:
1414
# Use an older ubuntu to compile with an older glibc
15-
os: [macos-latest, windows-latest, ubuntu-18.04]
15+
os: [macos-latest, windows-latest, ubuntu-20.04]
1616
include:
1717
- os: windows-latest
1818
binary_path: target/superoptimized/sqlpage.exe
1919
- os: macos-latest
2020
binary_path: target/superoptimized/sqlpage
21-
- os: ubuntu-18.04
21+
- os: ubuntu-20.04
2222
binary_path: target/superoptimized/sqlpage
2323
steps:
24-
- uses: actions/checkout@v2
25-
- uses: actions-rs/toolchain@v1
26-
with: {toolchain: stable, override: true}
27-
- name: build
28-
uses: actions-rs/cargo@v1
29-
with: { command: build, args: --profile superoptimized --locked }
30-
- uses: actions/upload-artifact@v1
24+
- uses: actions/checkout@v3
25+
- run: cargo build --profile superoptimized --locked
26+
- uses: actions/upload-artifact@v3
3127
with:
3228
name: sqlpage ${{ matrix.os }}
3329
path: ${{ matrix.binary_path }}
3430
create_release:
3531
name: Create Release
3632
needs: build
37-
runs-on: ubuntu-18.04
33+
runs-on: ubuntu-latest
3834
steps:
3935
- name: Checkout code
40-
uses: actions/checkout@master
41-
- name: get commit message
42-
run: echo commitmsg=$(git tag --format='%(subject)' -l | tail -n 1) >> $GITHUB_ENV
36+
uses: actions/checkout@v3
37+
- uses: actions/download-artifact@v3
38+
- run: cd 'sqlpage macos-latest' && chmod +x sqlpage && tar --create --file sqlpage-macos.tgz --gzip sqlpage
39+
- run: cd 'sqlpage ubuntu-20.04' && chmod +x sqlpage && tar --create --file sqlpage-linux.tgz --gzip sqlpage
4340
- name: Create Release
4441
id: create_release
45-
uses: actions/create-release@latest
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
uses: softprops/action-gh-release@v1
4843
with:
44+
name: ${{ github.ref_name }}
4945
tag_name: ${{ github.ref_name }}
50-
release_name: Release ${{ github.ref_name }}
51-
body: ${{ env.commitmsg }}
5246
draft: false
53-
prerelease: false
54-
55-
- uses: actions/download-artifact@v1
56-
with: { name: sqlpage windows-latest, path: . }
57-
- name: Upload Windows binary
58-
uses: lovasoa/upload-release-asset@851d9cc59fe8113912edffbd8fddaa09470a5ac0
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
with:
62-
upload_url: ${{ steps.create_release.outputs.upload_url }}
63-
asset_path: sqlpage.exe
64-
asset_name: sqlpage.exe
65-
asset_label: sqlpage for Windows
66-
asset_content_type: application/vnd.microsoft.portable-executable
67-
68-
- name: cleanup
69-
run: rm -rf ./*
70-
71-
- uses: actions/download-artifact@v1
72-
with: { name: sqlpage macos-latest, path: . }
73-
- run: chmod +x sqlpage && tar --create --file sqlpage-macos.tgz --gzip sqlpage
74-
- name: Upload MacOs binary
75-
uses: lovasoa/upload-release-asset@851d9cc59fe8113912edffbd8fddaa09470a5ac0
76-
env:
77-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78-
with:
79-
upload_url: ${{ steps.create_release.outputs.upload_url }}
80-
asset_path: sqlpage-macos.tgz
81-
asset_name: sqlpage-macos.tgz
82-
asset_label: sqlpage for MacOS
83-
asset_content_type: application/octet-stream
84-
85-
- name: cleanup
86-
run: rm -rf ./*
87-
88-
- uses: actions/download-artifact@v1
89-
with: { name: sqlpage ubuntu-18.04, path: . }
90-
- run: chmod +x sqlpage && tar --create --file sqlpage-linux.tgz --gzip sqlpage
91-
- name: Upload Linux binary
92-
uses: lovasoa/upload-release-asset@851d9cc59fe8113912edffbd8fddaa09470a5ac0
93-
env:
94-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
with:
96-
upload_url: ${{ steps.create_release.outputs.upload_url }}
97-
asset_path: sqlpage-linux.tgz
98-
asset_name: sqlpage-linux.tgz
99-
asset_label: sqlpage for Linux
100-
asset_content_type: application/octet-stream
47+
prerelease: ${{ startsWith(github.ref, 'refs/tags/v') }}
48+
files: |
49+
sqlpage windows-latest/sqlpage.exe
50+
sqlpage ubuntu-20.04/sqlpage-linux.tgz
51+
sqlpage macos-latest/sqlpage-macos.tgz

0 commit comments

Comments
 (0)