From 5dc0daf20d5dead06242541455accd1895c1bda9 Mon Sep 17 00:00:00 2001 From: Quang Phan Date: Fri, 4 Mar 2022 16:33:53 +0700 Subject: [PATCH] chore(github.actions): attempt to fix publish action --- .github/workflows/publish.yaml | 31 ++++++++++++++++++++++--------- .github/workflows/test.yaml | 16 ++++++++-------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 165c0eb..c8399f2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,22 +4,23 @@ on: workflow_dispatch jobs: publish: name: ipp_encoder Publication - environment: production runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 with: - path: main + token: ${{ secrets.GITHUB_TOKEN }} - name: Install Toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable override: true - - name: Publish - run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} - working-directory: ./encoder - continue-on-error: false + - name: Log Toolchain Information + run: | + rustc --version + rustfmt --version + rustup --version + cargo --version - name: Bump Version & Tag id: tag_version uses: mathieudutour/github-tag-action@v6.0 @@ -29,6 +30,18 @@ jobs: default_bump: patch tag_prefix: v github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Set New Version in Cargo.toml + uses: ciiiii/toml-editor@1.0.0 + with: + file: "./encoder/Cargo.toml" + key: "package.version" + value: "${{ steps.tag_version.outputs.new_version }}" + - name: Publish + uses: actions-rs/cargo@v1 + with: + command: publish + args: --token "${{ secrets.CRATES_IO_TOKEN }}" --manifest-path "./encoder/Cargo.toml" --allow-dirty + continue-on-error: false - name: Create a Github Release uses: ncipollo/release-action@v1 with: @@ -44,8 +57,8 @@ jobs: - name: Create Pull Request for Changelog uses: peter-evans/create-pull-request@v3 with: - commit-message: format('CHANGELOG update for release {0}', {{ steps.tag_version.outputs.new_tag }}) - title: format('CHANGELOG update for release {0}', {{ steps.tag_version.outputs.new_tag }}) - branch: format('changelog/{0}', {{ steps.tag_version.outputs.new_tag }}) + commit-message: ${{ format('CHANGELOG update for release {0}', steps.tag_version.outputs.new_tag) }} + title: ${{ format('CHANGELOG update for release {0}', steps.tag_version.outputs.new_tag) }} + branch: ${{ format('changelog/{0}', steps.tag_version.outputs.new_tag) }} base: main reviewers: vnphanquang diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fa267a5..cf4968e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macOS-latest] + os: [ubuntu-latest, windows-2019, macOS-latest] rust: [stable] include: - rust: stable @@ -39,15 +39,15 @@ jobs: command: fmt args: --all -- --check continue-on-error: ${{ matrix.can-fail }} - - name: Clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D clippy::all - continue-on-error: ${{ matrix.can-fail }} - name: Test Build uses: actions-rs/cargo@v1 with: command: build - args: --release --all-features + # only build ipp_encoder for now since astro-dnssd is failing currently for ipp_server on ubuntu + args: --release --all-features --manifest-path "./encoder/Cargo.toml" + continue-on-error: ${{ matrix.can-fail }} + - name: Clippy + run: cargo clippy -- -D clippy::all + # only clippy ipp_encoder for now since astro-dnssd is failing currently for ipp_server on ubuntu + working-directory: ./encoder continue-on-error: ${{ matrix.can-fail }}