Skip to content

Commit

Permalink
chore: prep for dist and update readme for compat
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed May 21, 2024
1 parent 73ee266 commit c0b773c
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 5 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/build-test-cross.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: cross compile dotnet app
on:
release:
types:
- published
push:
branches:
- "**"
Expand All @@ -22,9 +25,11 @@ jobs:
run: make size
- name: file info
run: make file
- name: prep for distribution
run: make dist
- uses: actions/upload-artifact@v4
with:
path: bin/*
path: dist/*

test:
defaults:
Expand Down Expand Up @@ -61,8 +66,11 @@ jobs:
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: list artifact
run: ls artifact/*
- name: list and unpack artifacts
run: |
ls artifact/*
cd artifact && gunzip *.gz
ls artifact/*
- name: Set up QEMU
if: matrix.arch == 'arm64' && matrix.docker == true
uses: docker/setup-qemu-action@v3
Expand All @@ -89,4 +97,22 @@ jobs:
run: artifact/hello_dotnet-win-x64/Explore.Cli.exe --version
- name: test 'ubuntu-latest'
if: ${{ matrix.os == 'ubuntu-latest' && matrix.docker != true }}
run: chmod +x artifact/hello_dotnet-linux-x64/Explore.Cli && artifact/hello_dotnet-linux-x64/Explore.Cli --version
run: chmod +x artifact/hello_dotnet-linux-x64/Explore.Cli && artifact/hello_dotnet-linux-x64/Explore.Cli --version

publish:
runs-on: ubuntu-latest
if: |
startsWith(github.ref, 'refs/tags/v')
needs: [build,test]

steps:
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Upload Release Assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifact/*
file_glob: true
tag: ${{ github.ref }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,6 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml

# distribution artifacts
/dist
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
all: build

APP_NAME = "hello_dotnet"
APP_NAME = "explore-cli"

RIDS = "linux-x64" "linux-arm64" "linux-musl-x64" "linux-musl-arm64" "osx-x64" "osx-arm64" "win-x64" "win-arm64"

Expand Down Expand Up @@ -36,6 +36,18 @@ file:
file bin/$(APP_NAME)-$$rid/*; \
done

dist:
mkdir -p dist
for rid in $(RIDS); do \
rm -f bin/$(APP_NAME)-$$rid/*.pdb; \
cd bin/$(APP_NAME)-$$rid; \
gzip --stdout --best *.Cli* > $(APP_NAME)-$$rid.gz; \
shasum -a 256 $(APP_NAME)-$$rid.gz > $(APP_NAME)-$$rid.gz.256; \
mv $(APP_NAME)-$$rid.gz ../../dist;\
mv $(APP_NAME)-$$rid.gz.256 ../../dist;\
cd ../../; \
done

clean:
@echo "Cleaning..."
@rm -rf bin
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,42 @@ You will need the following:

### Install the CLI

#### Nuget

Download and install the CLI tool from Nuget: https://www.nuget.org/packages/Explore.Cli

`dotnet tool install --global Explore.Cli`

#### GitHub Releases

Standalone releases of the Explore.CLI tool are published to GitHub Releases.

##### Supported Platforms

| OS | Architecture | Supported |
| ------- | ------------ | --------- |
| OSX | x86_64 ||
| Linux | x86_64 ||
| Windows | x86_64 ||
| OSX | arm64 ||
| Linux | arm64 ||
| Windows | arm64 ||
| Alpine | x86_64 ||
| Alpine | arm64 ||

###### Pre-requisites

- `libicu` - Linux musl and glibc based systems
- `gcc` - Linux musl based systems

###### Alpine

`apk add -y gcc icu`

###### Debian

`apt update && apt install -y libicu`

### Session Cookies for CLI command

You will need to obtain certain cookies from an active session in SwaggerHub Explore to invoke the `CLI` commands.
Expand Down

0 comments on commit c0b773c

Please sign in to comment.