Skip to content

Commit

Permalink
feat: rework and add apple m1 (#65)
Browse files Browse the repository at this point in the history
This reworks the application to be faster
and more responsive. Further, some commands are removed
since they were very biased.

BREAKING CHANGE: This removes some commands from the previous
version. Right now, only "context" and "namespace" are supported.
If other commands are necessary, they will be added as seen fit.
  • Loading branch information
buehler authored Mar 4, 2022
1 parent c8e751a commit 7253afc
Show file tree
Hide file tree
Showing 48 changed files with 1,808 additions and 1,716 deletions.
4 changes: 4 additions & 0 deletions .github/fetch_version/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"branches": ["master"],
"plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator"]
}
22 changes: 0 additions & 22 deletions .github/workflows/dotnet-release.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/dotnet-test.yml

This file was deleted.

182 changes: 182 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: Release Binary

on:
push:
branches:
- master

jobs:
get_next_version:
runs-on: ubuntu-latest
name: Fetch next version number
steps:
- uses: actions/checkout@v2
- name: semantic release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
dry_run: true
working_directory: .github/fetch_version
- run: echo ${{ steps.semantic.outputs.new_release_version }}
- run: echo ${{ steps.semantic.outputs.new_release_published }}
outputs:
create_release: ${{ steps.semantic.outputs.new_release_published }}
new_version: ${{ steps.semantic.outputs.new_release_version }}

build_windows:
needs: get_next_version
if: needs.get_next_version.outputs.create_release == 'true'
strategy:
fail-fast: true
matrix:
include:
- target: x86_64-pc-windows-msvc
openssl_target: openssl:x64-windows-static-md
name: Build ${{ matrix.target }} on windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: set new version number (${{ needs.get_next_version.outputs.new_version }})
run: (get-content -Path .\Cargo.toml) | %{$_ -replace "version = \`"0.0.0-development\`"","version = `"${{ needs.get_next_version.outputs.new_version }}`""} | set-content -Path .\Cargo.toml

- name: install and setup vcpkg
uses: lukka/run-vcpkg@v10.1
with:
vcpkgGitCommitId: b196dacc2f63f37bb75504c36c349042336749cb

- name: setup openssl
run: vcpkg install ${{ matrix.openssl_target }}

- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}

- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/kuby.exe
build_unix:
needs: get_next_version
if: needs.get_next_version.outputs.create_release == 'true'
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: Build ${{ matrix.target }} on ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: set new version number (${{ needs.get_next_version.outputs.new_version }})
run: sed -i -e 's/^version = .*/version = "${{ needs.get_next_version.outputs.new_version }}"/' Cargo.toml

- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}

- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/kuby
build_macos:
needs: get_next_version
if: needs.get_next_version.outputs.create_release == 'true'
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
- target: x86_64-apple-darwin
name: Build ${{ matrix.target }} on macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- name: set new version number (${{ needs.get_next_version.outputs.new_version }})
run: sed -i -e 's/^version = .*/version = "${{ needs.get_next_version.outputs.new_version }}"/' Cargo.toml

- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
use-cross: true
args: --release --target ${{ matrix.target }}

- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/kuby
create_release:
needs:
- build_windows
- build_unix
- build_macos
if: needs.get_next_version.outputs.create_release == 'true'
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3

- name: package m1 apple
uses: papeloto/action-zip@v1
with:
files: aarch64-apple-darwin/
dest: aarch64-apple-darwin.zip
- name: package intel apple
uses: papeloto/action-zip@v1
with:
files: x86_64-apple-darwin/
dest: x86_64-apple-darwin.zip
- name: package windows x64
uses: papeloto/action-zip@v1
with:
files: x86_64-pc-windows-msvc/
dest: x86_64-pc-windows-msvc.zip
- name: package unix
uses: papeloto/action-zip@v1
with:
files: x86_64-unknown-linux-gnu/
dest: x86_64-unknown-linux-gnu.zip

- name: create release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 1 addition & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1 @@
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# Ci things
node_modules/
tools/
nuget/
artifacts/
coverage/
.tmp/

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/

# Testing results
coverage.json
coverage.info
/target
1 change: 0 additions & 1 deletion .nuke

This file was deleted.

53 changes: 17 additions & 36 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
{
"verifyConditions": ["@semantic-release/github"],
"addChannel": ["@semantic-release/github"],
"prepare": [
[
"@semantic-release/exec",
{
"prepareCmd": "./build.sh --no-logo --version ${nextRelease.version} --target Publish"
}
]
],
"publish": [
[
"@semantic-release/github",
{
"assets": [
{
"path": "artifacts/linux-x64/kuby",
"name": "kuby-linux-x64",
"label": "Kuby for linux x64 (${nextRelease.gitTag})"
},
{
"path": "artifacts/osx-x64/kuby",
"name": "kuby-osx-x64",
"label": "Kuby for macOS / OSX x64 (${nextRelease.gitTag})"
},
{
"path": "artifacts/win-x64/kuby.exe",
"name": "kuby-win-x64.exe",
"label": "Kuby for windows x64 (${nextRelease.gitTag})"
}
]
}
]
]
}
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/github",
{
"assets": [
{
"path": "./*.zip"
}
]
}
]
]
}
Loading

0 comments on commit 7253afc

Please sign in to comment.