Skip to content

[refactor] 로깅 방법 변경 및 테스트 시 로그 표시 개선 (#191) #22

[refactor] 로깅 방법 변경 및 테스트 시 로그 표시 개선 (#191)

[refactor] 로깅 방법 변경 및 테스트 시 로그 표시 개선 (#191) #22

Workflow file for this run

name: Release
on:
push:
branches: [ main ]
paths:
- 'Cargo.toml'
workflow_dispatch:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Cargo.toml to check version
uses: actions/checkout@v4
with:
sparse-checkout: |
Cargo.toml
sparse-checkout-cone-mode: false
- name: Get rusaint version
id: current_version
run: yq '.workspace.package.version | "result=v" + .' Cargo.toml >> $GITHUB_OUTPUT
- name: Fetch latest release tag
id: latest_release
run: |
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/EATSTEAK/rusaint/releases \
| jq '.[0].tag_name | "result=" + .' \
| tr -d '"' >> $GITHUB_OUTPUT
- name: Cancel workflow if version is not updated
if: steps.current_version.outputs.result == steps.latest_release.outputs.result
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
- name: Clear directory
run: |
rm -rf ./*
rm -rf ./.git
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: 'armv7-linux-androideabi, i686-linux-android, aarch64-linux-android, x86_64-linux-android'
- name: Retrieve cache
uses: Leafwing-Studios/cargo-cache@v2
- name: Publish
run: cargo publish --package rusaint --verbose --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
- name: Create an GitHub Release
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/EATSTEAK/rusaint/releases \
-d '{"tag_name":"${{ steps.current_version.outputs.result }}","name":"${{ steps.current_version.outputs.result }}","generate_release_notes":true}'