Skip to content

Commit

Permalink
test optional openssl-sys
Browse files Browse the repository at this point in the history
  • Loading branch information
nbari committed Dec 15, 2023
1 parent a66c865 commit bda32ad
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 103 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
name: Build

on:
push:
branches:
- develop
workflow_dispatch:

permissions:
contents: write

jobs:
test:
uses: ./.github/workflows/test.yml
with:
branch: develop

build:
name: Build and release
runs-on: ${{ matrix.os }}
needs: test

strategy:
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl

- build: macos
os: macos-latest
target: x86_64-apple-darwin

- build: windows
os: windows-latest
target: x86_64-pc-windows-msvc

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get the release version from the tag
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- run: sudo apt -y install musl-dev musl-tools
if: matrix.build == 'linux'

- run: choco install openssl
if: matrix.build == 'windows'

- run: echo 'OPENSSL_DIR=C:\Program Files\OpenSSL-Win64' | Out-File -FilePath
$env:GITHUB_ENV -Append
if: matrix.build == 'windows'

- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Build archive
shell: bash
run: |-
binary_name="gbump"
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}"
mkdir "$dirname"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
mv "target/${{ matrix.target }}/release/$binary_name.exe" "$dirname"
else
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname"
fi
if [ "${{ matrix.os }}" = "windows-latest" ]; then
7z a "$dirname.zip" "$dirname"
echo "ASSET=$dirname.zip" >> $GITHUB_ENV
else
tar -czf "$dirname.tar.gz" "$dirname"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
fi
100 changes: 1 addition & 99 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ categories = ["command-line-utilities", "os"]
license = "BSD-3-Clause"
edition = "2018"

[badges]
travis-ci = { repository = "nbari/gbump", branch = "master" }

[dependencies]
regex = "1.8"
clap = "4"
openssl = { version = "0.10", optional = true, features = ["vendored"] }
openssl-sys = { version = "0.9", optional = true }
git2 = "0.18"

0 comments on commit bda32ad

Please sign in to comment.