|
1 | 1 | name: Release
|
2 |
| - |
3 | 2 | on:
|
4 | 3 | push:
|
5 | 4 | tags:
|
6 | 5 | - "*"
|
7 |
| - |
8 | 6 | 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 }} |
9 | 18 | linux:
|
10 | 19 | runs-on: ubuntu-latest
|
| 20 | + permissions: |
| 21 | + contents: write |
| 22 | + packages: write |
| 23 | + needs: [release] |
11 | 24 | steps:
|
12 |
| - - uses: actions/checkout@v3 |
| 25 | + - uses: actions/checkout@v4 |
13 | 26 | - uses: actions-rs/toolchain@v1
|
14 | 27 | with:
|
15 | 28 | toolchain: stable
|
16 | 29 | default: true
|
17 | 30 | - 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 }} |
22 | 36 | macos:
|
23 | 37 | runs-on: macos-latest
|
| 38 | + permissions: |
| 39 | + contents: write |
| 40 | + packages: write |
| 41 | + needs: [release] |
24 | 42 | steps:
|
25 |
| - - uses: actions/checkout@v3 |
| 43 | + - uses: actions/checkout@v4 |
26 | 44 | - uses: actions-rs/toolchain@v1
|
27 | 45 | with:
|
28 | 46 | toolchain: stable
|
29 | 47 | default: true
|
30 | 48 | - 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 }} |
35 | 54 | windows:
|
36 | 55 | runs-on: windows-latest
|
| 56 | + permissions: |
| 57 | + contents: write |
| 58 | + packages: write |
| 59 | + needs: [release] |
37 | 60 | steps:
|
38 |
| - - uses: actions/checkout@v3 |
| 61 | + - uses: actions/checkout@v4 |
39 | 62 | - uses: actions-rs/toolchain@v1
|
40 | 63 | with:
|
41 | 64 | toolchain: stable
|
42 | 65 | default: true
|
43 | 66 | - 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 |
55 | 70 | env:
|
56 | 71 | 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 |
0 commit comments