Skip to content

Commit

Permalink
Add windows binary to release
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewillmon committed Aug 30, 2024
1 parent 56496cd commit 77eca94
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ jobs:
os: macos-14
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-pc-windows-msvc
os: windows-latest
extension: .exe
flags: --no-default-features
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repo
Expand All @@ -68,20 +72,25 @@ jobs:
name: Install protoc
run: sudo apt update && sudo apt install -y protobuf-compiler

- name: Install Rust toolchain
- if: ${{ runner.os == 'Windows' }}
name: Install Rust toolchain
run: rustup toolchain install stable --profile minimal --target ${{ matrix.target }}

- if: ${{ runner.os != 'Windows' }}
name: Install Rust toolchain
run: |
curl https://sh.rustup.rs -sSf \
| sh -s -- -y --default-toolchain stable --profile minimal --target ${{ matrix.target }}
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Build Distributions
run: cargo build --release --target ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.target }} ${{ matrix.flags }}

- name: Upload release artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: phylum-${{ matrix.target }}
path: ./target/${{ matrix.target }}/release/phylum
path: ./target/${{ matrix.target }}/release/phylum${{ matrix.extension }}
if-no-files-found: error
retention-days: 7

Expand All @@ -103,7 +112,7 @@ jobs:

- name: Prep archives
run: |
for archive in phylum-*/;
for archive in phylum-*-apple-*/ phylum-*-linux-*/;
do
archive=$(echo "${archive}" | sed -e "s/\/$//")
cp -R shell-completions "${archive}/completions"
Expand All @@ -116,12 +125,19 @@ jobs:
chmod a+x "${archive}/phylum"
zip -r "${archive}.zip" "${archive}"
done
for archive in phylum-*-windows-*/;
do
archive=$(echo "${archive}" | sed -e "s/\/$//")
mv "${archive}/phylum.exe" "${archive}.exe
done
- name: Upload release artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: release-archives
path: phylum-*.zip
path: |
phylum-*.zip
phylum-*.exe
if-no-files-found: error
retention-days: 7

Expand Down

0 comments on commit 77eca94

Please sign in to comment.