Skip to content

Commit 1a2bf9f

Browse files
committed
update github actions
1 parent c16fd4e commit 1a2bf9f

File tree

2 files changed

+42
-71
lines changed

2 files changed

+42
-71
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,71 @@
11
name: Release
2-
32
on:
43
push:
54
tags:
65
- "*"
7-
86
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
packages: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: create release
15+
run: gh release create "v${{ github.ref_name }}" -t "v${{ github.ref_name }}"
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
918
linux:
1019
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
packages: write
23+
needs: [release]
1124
steps:
12-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
1326
- uses: actions-rs/toolchain@v1
1427
with:
1528
toolchain: stable
1629
default: true
1730
- run: cargo build --release -j`nproc`
18-
- uses: actions/upload-artifact@v1
19-
with:
20-
name: linux-artifact
21-
path: target/release/nomino
31+
- run: |
32+
mv target/release/nomino nomino-linux-64bit
33+
gh release upload "v${{ github.ref_name }}" nomino-linux-64bit --clobber
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2236
macos:
2337
runs-on: macos-latest
38+
permissions:
39+
contents: write
40+
packages: write
41+
needs: [release]
2442
steps:
25-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
2644
- uses: actions-rs/toolchain@v1
2745
with:
2846
toolchain: stable
2947
default: true
3048
- run: cargo build --release -j`sysctl -n hw.physicalcpu`
31-
- uses: actions/upload-artifact@v1
32-
with:
33-
name: macos-artifact
34-
path: target/release/nomino
49+
- run: |
50+
mv target/release/nomino nomino-macos-64bit
51+
gh release upload "v${{ github.ref_name }}" nomino-macos-64bit --clobber
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3554
windows:
3655
runs-on: windows-latest
56+
permissions:
57+
contents: write
58+
packages: write
59+
needs: [release]
3760
steps:
38-
- uses: actions/checkout@v3
61+
- uses: actions/checkout@v4
3962
- uses: actions-rs/toolchain@v1
4063
with:
4164
toolchain: stable
4265
default: true
4366
- run: cargo build --release
44-
- uses: actions/upload-artifact@v1
45-
with:
46-
name: windows-artifact
47-
path: target\release\nomino.exe
48-
deploy:
49-
needs: [linux, macos, windows]
50-
runs-on: ubuntu-latest
51-
steps:
52-
- name: Create release
53-
id: create_release
54-
uses: actions/create-release@v1
67+
- run: |
68+
mv target/release/nomino.exe nomino-windows-64bit.exe
69+
gh release upload "v${{ github.ref_name }}" nomino-windows-64bit.exe --clobber
5570
env:
5671
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
with:
58-
tag_name: ${{ github.ref }}
59-
release_name: v${{ github.ref }}
60-
draft: false
61-
prerelease: false
62-
- name: Download linux artifact
63-
uses: actions/download-artifact@v1
64-
with:
65-
name: linux-artifact
66-
- name: Upload linux artifact
67-
uses: actions/upload-release-asset@v1
68-
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70-
with:
71-
upload_url: ${{ steps.create_release.outputs.upload_url }}
72-
asset_path: linux-artifact/nomino
73-
asset_name: nomino-linux-64bit
74-
asset_content_type: application/octet-stream
75-
- name: Download macos artifact
76-
uses: actions/download-artifact@v1
77-
with:
78-
name: macos-artifact
79-
- name: Upload macos artifact
80-
uses: actions/upload-release-asset@v1
81-
env:
82-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83-
with:
84-
upload_url: ${{ steps.create_release.outputs.upload_url }}
85-
asset_path: macos-artifact/nomino
86-
asset_name: nomino-macos-64bit
87-
asset_content_type: application/octet-stream
88-
- name: Download windows artifact
89-
uses: actions/download-artifact@v1
90-
with:
91-
name: windows-artifact
92-
- name: Upload windows artifact
93-
uses: actions/upload-release-asset@v1
94-
env:
95-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96-
with:
97-
upload_url: ${{ steps.create_release.outputs.upload_url }}
98-
asset_path: windows-artifact/nomino.exe
99-
asset_name: nomino-windows-64bit.exe
100-
asset_content_type: application/octet-stream

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
linux:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- uses: actions-rs/toolchain@v1
1515
with:
1616
default: true
@@ -29,7 +29,7 @@ jobs:
2929
macos:
3030
runs-on: macos-latest
3131
steps:
32-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
3333
- uses: actions-rs/toolchain@v1
3434
with:
3535
default: true
@@ -40,7 +40,7 @@ jobs:
4040
windows:
4141
runs-on: windows-latest
4242
steps:
43-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4444
- uses: actions-rs/toolchain@v1
4545
with:
4646
default: true

0 commit comments

Comments
 (0)