4747 rustup update stable
4848 rustup component add rustfmt rust-src clippy
4949 rustup target add ${{ matrix.target }}
50+ rustup target add wasm32-unknown-unknown
51+ cargo install wasm-pack --force
5052 - name : Run Tests (univ)
5153 run : cargo test --features univ
5254 - name : Run Tests (wasm)
@@ -70,22 +72,35 @@ jobs:
7072 # APPLE_CODESIGN_PASSWORD: '${{ secrets.APPLE_CODESIGN_PASSWORD }}'
7173 # echo Key is $(echo $APPLE_CODESIGN_KEY | base64 -d | wc -c) bytes
7274 # rcodesign sign target/release/basjoofan --code-signature-flags=runtime --p12-password=$APPLE_CODESIGN_PASSWORD --p12-file=<(echo $APPLE_CODESIGN_KEY | base64 -d) --entitlements-xml-file=cli/entitlements.plist
73- - name : Compress Archive (darwin or linux)
75+ # - name: Compress Archive (darwin or linux)
76+ # if: contains(matrix.target, 'darwin') || contains(matrix.target, 'linux')
77+ # run: zip -rj target/${{ matrix.target }}/release/basjoofan-${{ matrix.target }}.zip target/${{ matrix.target }}/release/basjoofan
78+ # - name: Compress Archive (windows)
79+ # if: contains(matrix.target, 'windows')
80+ # run: Compress-Archive -CompressionLevel Optimal -Force -Path target/${{ matrix.target }}/release/basjoofan.exe -DestinationPath target/${{ matrix.target }}/release/basjoofan-${{ matrix.target }}.zip
81+ - name : Echo Version (darwin or linux)
7482 if : contains(matrix.target, 'darwin') || contains(matrix.target, 'linux')
75- run : zip -rj target/${{ matrix.target }}/release/basjoofan-${{ matrix.target }}.zip target/${{ matrix.target }}/release/basjoofan
76- - name : Compress Archive (windows)
83+ run : echo version=$(grep '^version' ./cmd/Cargo.toml | head -1 | cut -d '"' -f2) >> $GITHUB_ENV
84+ - name : Naming (darwin or linux)
85+ if : contains(matrix.target, 'darwin') || contains(matrix.target, 'linux')
86+ run : mv target/${{ matrix.target }}/release/basjoofan target/${{ matrix.target }}/release/basjoofan-${{ env.version }}-${{ matrix.target }}
87+ - name : Echo Version (windows)
88+ if : contains(matrix.target, 'windows')
89+ run : echo version=$((Get-Content ./cmd/Cargo.toml | Select-String '^version').ToString().Split('"')[1]) >> $GITHUB_ENV
90+ - name : Naming (windows)
7791 if : contains(matrix.target, 'windows')
78- run : Compress-Archive -CompressionLevel Optimal -Force - Path target/${{ matrix.target }}/release/basjoofan.exe -DestinationPath target/ ${{ matrix.target }}/release/basjoofan -${{ matrix.target }}.zip
92+ run : Rename-Item - Path target/${{ matrix.target }}/release/basjoofan.exe -NewName basjoofan- ${{ env.version }}-${{ matrix.target }}.exe
7993 - name : Upload Artifacts
8094 uses : actions/upload-artifact@v4
8195 with :
82- name : basjoofan-${{ matrix.target }}
83- path : target/${{ matrix.target }}/release/basjoofan${{ contains(matrix.target, 'windows') && '.exe' || '' }}
96+ name : basjoofan-${{ env.version }}-${{ matrix.target }}
97+ path : target/${{ matrix.target }}/release/basjoofan-${{ env.version }}-${{ matrix.target }}${{ contains(matrix.target, 'windows') && '.exe' || '' }}
98+ if-no-files-found : error
8499 - name : Release Version
85100 uses : softprops/action-gh-release@v2
86101 if : startsWith(github.ref, 'refs/tags/')
87102 env :
88103 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89104 with :
90- files : target/${{ matrix.target }}/release/basjoofan-${{ matrix.target }}.zip
105+ files : target/${{ matrix.target }}/release/basjoofan-${{ env.version }}-${{ matrix.target }}${{ contains(matrix.target, 'windows') && '.exe' || '' }}
91106 draft : true
0 commit comments