Skip to content

Commit

Permalink
feat: Update workflow to auto publish binary
Browse files Browse the repository at this point in the history
  • Loading branch information
mautamu committed Aug 7, 2023
1 parent f9df66c commit c3df754
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 32 deletions.
48 changes: 26 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,8 @@ jobs:
matrix:
include:
- os: ubuntu-latest
rust_target: x86_64-unknown-linux-musl
asset_name: action-validator_linux_amd64
- os: macos-latest
rust_target: x86_64-apple-darwin
asset_name: action-validator_darwin_amd64
- os: ubuntu-latest
rust_target: aarch64-unknown-linux-musl
asset_name: action-validator_linux_arm64
- os: macos-latest
rust_target: aarch64-apple-darwin
asset_name: action-validator_darwin_arm64
rust_target: x86_64-unknown-linux-gnu
asset_name: leftwm-theme_x86_64_linux_gnu

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -52,16 +43,22 @@ jobs:
env:
RELEASE_TAG: ${{ github.ref }}
run: |
mv Cargo.toml Cargo.toml.orig
sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.toml.orig >Cargo.toml
mv Cargo.lock Cargo.lock.orig
sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.lock.orig >Cargo.lock
mv Cargo.toml Cargo.toml.origl2
sed "s/[0-9]*\\.[0-9]*\\.[0-9]*-git/${RELEASE_TAG##*\/v}/" Cargo.toml.origl2 > Cargo.toml
mv Cargo.lock Cargo.lock.origl2
sed "s/[0-9]*\\.[0-9]*\\.[0-9]*-git/${RELEASE_TAG##*\/v}/" Cargo.lock.origl2 > Cargo.lock
- name: Install cross-compile linker for aarch64-unknown-linux-musl
if: matrix.rust_target == 'aarch64-unknown-linux-musl'
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu
- name: Install openssl
run: |
sudo apt update
sudo apt install openssl pkg-config libssl-dev
cargo clean
OPENSSL_LIB_DIR="/usr/lib/x86_64-linux-gnu"
OPENSSL_INCLUDE_DIR="/usr/include/openssl"
- name: Build
env:
Expand Down Expand Up @@ -99,20 +96,27 @@ jobs:
id: rust-install
uses: dtolnay/rust-toolchain@stable

- name: Install openssl
run: |
sudo apt update
sudo apt install openssl pkg-config libssl-dev
cargo clean
OPENSSL_LIB_DIR="/usr/lib/x86_64-linux-gnu"
OPENSSL_INCLUDE_DIR="/usr/include/openssl"
- name: Set Cargo.toml version
if: github.event_name == 'release'
shell: bash
env:
RELEASE_TAG: ${{ github.ref }}
run: |
mv Cargo.toml Cargo.toml.orig
sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.toml.orig >Cargo.toml
mv Cargo.lock Cargo.lock.orig
sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.lock.orig >Cargo.lock
mv Cargo.toml Cargo.toml.origl2
sed "s/[0-9]*\\.[0-9]*\\.[0-9]*-git/${RELEASE_TAG##*\/v}/" Cargo.toml.origl2 > Cargo.toml
mv Cargo.lock Cargo.lock.origl2
sed "s/[0-9]*\\.[0-9]*\\.[0-9]*-git/${RELEASE_TAG##*\/v}/" Cargo.lock.origl2 > Cargo.lock
- name: Publish crate
if: github.event_name == 'release'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish --allow-dirty
29 changes: 20 additions & 9 deletions Cargo.lock

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

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[package]
name = "leftwm-theme"
version = "0.1.1"
version = "0.1.2-git"
authors = ["Lex Childs <[email protected]>", "Hitesh Paul <[email protected]>", "Mautamu <[email protected]>"]
description = "A theme mangager for LeftWM"
edition = "2018"
keywords = ["leftwm", "wm", "theme"]
license = "MIT"
repository = "https://github.com/leftwm/leftwm-theme"
readme = "README.md"
resolver="1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -32,3 +33,8 @@ tempfile = "3.2.0"
toml = "0.5.5"
xdg = "2.2.0"
url = "2.2.2"


[dependencies.openssl-sys]
version = "0.9"
features = ["vendored"]

0 comments on commit c3df754

Please sign in to comment.