change println to debug #80
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
tags: | |
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-amd64-linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install musl | |
run: sudo apt install musl musl-dev musl-tools make gcc -y | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Install latest nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
target: x86_64-unknown-linux-musl | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target=x86_64-unknown-linux-musl | |
- name: Tar | |
run: tar -czvf ocipack-${{ env.RELEASE_VERSION }}-amd64_linux.tar.gz -C ./target/x86_64-unknown-linux-musl/release/ ocipack | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./ocipack-${{ env.RELEASE_VERSION }}-amd64_linux.tar.gz | |
build-amd64-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Env | |
run: SET RELEASE_VERSION=$($env:GITHUB_REF -replace "refs/tags/") | |
- name: Print Env | |
run: | | |
chcp 65001 #set code page to utf-8 | |
echo ("RELEASE_VERSION=" + $env:GITHUB_REF.replace('refs/tags/', '')) >> $env:GITHUB_ENV | |
- name: Install latest nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- name: Rename | |
run: cp ./target/release/ocipack.exe ./ | |
- name: Run UPX | |
uses: crazy-max/ghaction-upx@v2 | |
with: | |
version: latest | |
files: | | |
./ocipack.exe | |
- name: Zip | |
run: Compress-Archive ./ocipack.exe ocipack-${{ env.RELEASE_VERSION }}-amd64_windows.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./ocipack-${{ env.RELEASE_VERSION }}-amd64_windows.zip | |
build-amd64-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Install latest nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- name: Tar | |
run: tar -czvf ocipack-${{ env.RELEASE_VERSION }}-amd64_darwin.tar.gz -C ./target/release/ ocipack | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./ocipack-${{ env.RELEASE_VERSION }}-amd64_darwin.tar.gz |