Skip to content

Commit

Permalink
Update cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
akiomik committed Jan 9, 2024
1 parent affb5a8 commit 0260aef
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ on:

jobs:
publish:

name: Publishing for ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
Expand Down Expand Up @@ -56,48 +54,36 @@ jobs:
binary-postfix: ""
use-cross: true
binary-name: nostui

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable

target: ${{ matrix.target }}

profile: minimal
override: true
- uses: Swatinem/rust-cache@v2
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build

use-cross: ${{ matrix.use-cross }}

toolchain: stable

args: --release --target ${{ matrix.target }}


- name: install strip command
shell: bash
run: |
if [[ ${{ matrix.target }} == aarch64-unknown-linux-gnu ]]; then
sudo apt update
sudo apt-get install -y binutils-aarch64-linux-gnu
fi
- name: Packaging final binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
####### reduce binary size by removing debug symbols #######
BINARY_NAME=${{ matrix.binary-name }}${{ matrix.binary-postfix }}
Expand All @@ -118,7 +104,6 @@ jobs:
########## create sha256 ##########
if [[ ${{ runner.os }} == 'Windows' ]]; then
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
else
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
Expand All @@ -127,15 +112,11 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.target }}/release/${{ matrix.binary-name }}-*.tar.gz
target/${{ matrix.target }}/release/${{ matrix.binary-name }}-*.sha256
env:

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


publish-cargo:
name: Publishing to Cargo
runs-on: ubuntu-latest
Expand All @@ -147,6 +128,4 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo publish
env:

CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 0260aef

Please sign in to comment.