Skip to content

Commit

Permalink
Add release workflow. Refomatting of test data.
Browse files Browse the repository at this point in the history
  • Loading branch information
GJKrupa committed Oct 5, 2023
1 parent da39c8c commit 7d6122f
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 8 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 'Release'

on:
push:
tags:
- 'v*'

env:
CARGO_INCREMENTAL: 0

jobs:
build:
name: Binary
strategy:
fail-fast: false
matrix:
job:
- { target: x86_64-unknown-linux-musl, exe: amd64-linux, os: ubuntu-latest, features: default }
- { target: x86_64-apple-darwin, exe: amd64-macos, os: macos-latest, features: default }
- { target: aarch64-apple-darwin, exe: arm64-macos, os: macos-latest, features: default }
runs-on: ${{ matrix.job.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.job.target }}
components: rust-src
- uses: actions-rs/cargo@v1
with:
use-cross: true
args: --release --target=${{ matrix.job.target }} --locked
command: build
- name: Rename result
run: |
cp target/${{ matrix.job.target }}/release/manplan manplan-${{ matrix.job.exe }}
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: binary
path: manplan-${{ matrix.job.exe }}

release:
name: "Tagged Release"
runs-on: "ubuntu-20.04"
needs: build
steps:
- uses: actions/download-artifact@v2
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
./binary/manplan-amd64-macos
./binary/manplan-arm64-macos
./binary/manplan-amd64-linux
13 changes: 11 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
[package]
name = "manplan"
version = "0.1.0"
authors = ["Gerard Krupa"]
edition = "2021"
description = "Tool for keeping sdkman candidates up-to-date"
license = "Apache-2.0"
readme = "README.md"
categories = ["command-line-utilities"]
repository = "https://github.com/krupa-dev/manplan"

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

[dependencies]
regex = "1.9.6"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.9"
maplit = "1.0.2"
clap = { version = "4.4.6", features = ["derive"] }

[profile.release]
lto = "fat"
strip = "debuginfo"
12 changes: 6 additions & 6 deletions src/sdkman/candidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ mod test {
fn sample_kotlin_versions_parsed_in_order() {
let candidate = SdkManCandidate {
name: "kotlin".to_string(),
output:
"================================================================================
output: "
================================================================================
Available Kotlin Versions
================================================================================
> * 1.9.0 1.4.20 1.2.70 1.1.4
Expand All @@ -101,7 +101,7 @@ Available Kotlin Versions
* - installed
> - currently in use
================================================================================"
.to_string(),
.to_string(),
};
let expected = vec![
"1.9.0", "1.8.20", "1.4.20", "1.4.10", "1.2.70", "1.2.61", "1.1.4", "1.1.3-2",
Expand All @@ -113,8 +113,8 @@ Available Kotlin Versions
fn sample_java_versions_parsed_in_order() {
let candidate = SdkManCandidate {
name: "java".to_string(),
output:
"================================================================================
output: "
================================================================================
Available Java Versions for macOS ARM 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
Expand All @@ -135,7 +135,7 @@ Or install a specific version by Identifier:
$ sdk install java 17.0.8.1-tem
Hit Q to exit this list view
================================================================================"
.to_string(),
.to_string(),
};
let expected = vec![
"21-amzn",
Expand Down

0 comments on commit 7d6122f

Please sign in to comment.