|
8 | 8 | CARGO_TERM_COLOR: always |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - build: |
12 | | - name: Build ${{ matrix.target.name }} package |
13 | | - runs-on: ${{ matrix.target.os }} |
14 | | - strategy: |
15 | | - matrix: |
16 | | - target: |
17 | | - [ |
18 | | - { name: x86_64-unknown-linux-gnu, os: ubuntu-latest }, |
19 | | - { name: aarch64-apple-darwin, os: macos-latest }, |
20 | | - { name: x86_64-apple-darwin, os: macos-latest }, |
21 | | - { |
22 | | - name: x86_64-pc-windows-msvc, |
23 | | - os: windows-latest, |
24 | | - extension: .exe, |
25 | | - }, |
26 | | - ] |
27 | | - steps: |
28 | | - - name: Fetch latest code |
29 | | - uses: actions/checkout@v3 |
30 | | - - name: Setup Rust toolchain |
31 | | - run: rustup target add ${{ matrix.target.name }} |
32 | | - - name: Build |
33 | | - run: cargo build --release --locked --target ${{ matrix.target.name }} |
34 | | - - name: Compress |
35 | | - run: | |
36 | | - mv target/${{ matrix.target.name }}/release/<NAME>${{ matrix.target.extension }} . |
37 | | - zstd --ultra -22 -o <NAME>-${{ matrix.target.name }}.zst <NAME>${{ matrix.target.extension }} |
38 | | - - name: Collect artifact |
39 | | - run: | |
40 | | - mkdir -p artifacts |
41 | | - mv <NAME>-${{ matrix.target.name }}.zst artifacts |
42 | | - - name: Upload artifact |
43 | | - uses: actions/upload-artifact@v3.1.2 |
44 | | - with: |
45 | | - name: artifacts |
46 | | - path: artifacts |
47 | | - |
48 | 11 | release: |
49 | 12 | name: Release |
50 | 13 | runs-on: ubuntu-latest |
51 | | - needs: [build] |
52 | 14 | steps: |
53 | | - - name: Download artifacts |
54 | | - uses: actions/download-artifact@v3 |
55 | | - with: |
56 | | - name: artifacts |
57 | | - path: artifacts |
58 | | - - name: Hash |
59 | | - run: | |
60 | | - cd artifacts |
61 | | - sha256sum * | tee ../SHA256 |
62 | | - md5sum * | tee ../MD5 |
63 | | - mv ../SHA256 . |
64 | | - mv ../MD5 . |
65 | 15 | - name: Publish |
66 | 16 | uses: softprops/action-gh-release@v1 |
67 | 17 | with: |
68 | 18 | discussion_category_name: Announcements |
69 | 19 | generate_release_notes: true |
70 | | - files: artifacts/* |
71 | | - |
72 | | - # publish-on-crates-io: |
73 | | - # name: Publish on crates.io |
74 | | - # runs-on: ubuntu-latest |
75 | | - # steps: |
76 | | - # - name: Fetch latest code |
77 | | - # uses: actions/checkout@v3 |
78 | | - # - name: Login |
79 | | - # run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} |
80 | | - # - name: Publish |
81 | | - # run: .maintain/release.sh |
82 | 20 |
|
83 | | - clean-artifacts: |
84 | | - name: Clean artifacts |
85 | | - if: always() |
86 | | - needs: [release] |
87 | | - steps: |
88 | | - - name: Clean artifacts |
89 | | - uses: geekyeggo/delete-artifact@v2 |
90 | | - with: |
91 | | - name: artifacts |
| 21 | + publish-on-crates-io: |
| 22 | + name: Publish on crates.io |
92 | 23 | runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - name: Fetch latest code |
| 26 | + uses: actions/checkout@v3 |
| 27 | + - name: Login |
| 28 | + run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} |
| 29 | + - name: Publish |
| 30 | + run: .maintain/release.sh |
0 commit comments