Skip to content

Commit

Permalink
initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
Pvlerick committed Oct 17, 2024
0 parents commit e1d453d
Show file tree
Hide file tree
Showing 12 changed files with 2,213 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- octocat
categories:
- title: Breaking Changes 🛠
labels:
- Semver-Major
- breaking-change
- title: Exciting New Features 🎉
labels:
- Semver-Minor
- enhancement
- title: Other Changes
labels:
- "*"
63 changes: 63 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Main

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
checks:
name: Checks
runs-on: ubuntu-latest

steps:
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
targets: x86_64-unknown-linux-gnu

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

- name: Check Formatting
run: cargo fmt --all --check

- name: Cargo Check
run: cargo check

build:
name: Build
runs-on: ubuntu-latest

strategy:
matrix:
include:
- build: linux-gnu
target: x86_64-unknown-linux-gnu
- build: linux-musl
target: x86_64-unknown-linux-musl

steps:
- name: Ubuntu Setup
if: matrix.build == 'linux-musl'
run: |
sudo apt update
sudo apt install -y --no-install-recommends musl-tools
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: ${{ matrix.target }}

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

- name: Build
run: cargo build --target ${{ matrix.target }}
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

env:
bin_name: kubectl-copi

jobs:
build:
name: Build
runs-on: ubuntu-latest

strategy:
matrix:
include:
- build: linux-gnu
target: x86_64-unknown-linux-gnu
- build: linux-musl
target: x86_64-unknown-linux-musl

steps:
- name: Ubuntu Setup
if: matrix.build == 'linux-musl'
run: |
sudo apt update
sudo apt install -y --no-install-recommends musl-tools
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: ${{ matrix.target }}

- name: Sources Checkout
uses: actions/checkout@v2

- name: Set Version in Cargo.toml
run: |
sed -i 's/version = "0.1.0" ###/version = "${{ github.ref_name }}"/g' Cargo.toml
- name: Build Release
run: cargo build --release --target ${{ matrix.target }}

- name: Set "archive" Env Variable
run: echo "archive=$(echo ${{ env.bin_name }}_${{ github.ref_name }}_${{ matrix.target }}.tar.gz)" >> "$GITHUB_ENV"

- name: Create Archive and SHASUM
run: |
mv ./target/${{ matrix.target }}/release/${{ env.bin_name }} .
tar -czf ./${{ env.archive }} ${{ env.bin_name }} LICENSE
sha256sum ${{ env.archive }} > ${{ env.archive }}.sha256
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.archive }}
path: ./${{ env.archive }}*

release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4

- name: Tree
run: tree

- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: '**/kubectl-rsh_*.tar.gz*'


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit e1d453d

Please sign in to comment.