|
9 | 9 | CARGO_TERM_COLOR: always |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - # Create the release without assets, saves the upload url for later jobs to upload assets to |
| 12 | + # Create the release without assets |
13 | 13 | create_release: |
14 | 14 | name: Create release |
15 | 15 | runs-on: ubuntu-latest |
16 | 16 | steps: |
17 | 17 | - uses: actions/checkout@v3 |
18 | | - # - name: Ensure tag matches cargo version |
19 | | - # run: | |
20 | | - # CARGO_PKG_VERSION=$(cargo pkgid | cut -d# -f2) |
21 | | - # if [ "${{ github.ref_name }}" != "$CARGO_PKG_VERSION" ]; then |
22 | | - # echo "Tag ${{ github.ref_name }} does not match cargo version $CARGO_PKG_VERSION" |
23 | | - # exit 1 |
24 | | - # fi |
| 18 | + - name: Ensure tag matches cargo version |
| 19 | + run: | |
| 20 | + CARGO_PKG_VERSION=$(cargo pkgid | cut -d# -f2) |
| 21 | + if [ "${{ github.ref_name }}" != "$CARGO_PKG_VERSION" ]; then |
| 22 | + echo "Tag ${{ github.ref_name }} does not match cargo version $CARGO_PKG_VERSION" |
| 23 | + exit 1 |
| 24 | + fi |
25 | 25 | - name: Prepare release notes |
26 | 26 | run: node .github/scripts/get-release-notes.js ${{ github.ref_name }} >> release_notes.md |
27 | 27 | - name: Create release |
28 | 28 | uses: softprops/action-gh-release@v1 |
29 | 29 | with: |
30 | | - # tag_name: ${{ github.ref_name }} |
31 | 30 | body_path: ./release_notes.md |
32 | 31 |
|
| 32 | + # Create the binaries and upload them as release assets |
33 | 33 | create_binaries: |
34 | | - name: Create binaries |
| 34 | + name: Create binary |
35 | 35 | needs: create_release |
36 | 36 | runs-on: ${{ matrix.os }} |
| 37 | + env: |
| 38 | + BINARY_EXT: ${{ matrix.os == 'windows-latest' && '.exe' || '' }} |
37 | 39 | strategy: |
38 | 40 | fail-fast: false |
39 | 41 | matrix: |
|
57 | 59 | - name: Build |
58 | 60 | run: cargo build --bin uiua --release --target ${{ matrix.target }} --verbose |
59 | 61 |
|
60 | | - - if: matrix.os == 'windows-latest' |
61 | | - name: Zip (Windows) |
62 | | - run: 7z a -tzip uiua-bin-${{matrix.target}}.zip ./target/${{matrix.target}}/release/uiua.exe |
63 | | - - if: matrix.os != 'windows-latest' |
64 | | - name: Zip (Linux/MacOS) |
65 | | - run: 7z a -tzip uiua-bin-${{matrix.target}}.zip ./target/${{matrix.target}}/release/uiua |
| 62 | + - name: Zip |
| 63 | + run: 7z a -tzip uiua-bin-${{matrix.target}}.zip ./target/${{matrix.target}}/release/uiua${{env.BINARY_EXT}} |
66 | 64 |
|
67 | 65 | - name: Upload release assets |
68 | 66 | uses: softprops/action-gh-release@v1 |
|
0 commit comments