diff --git a/.github/actions/replace-version/action.yml b/.github/actions/replace-version/action.yml index 0f65d42..cf79026 100644 --- a/.github/actions/replace-version/action.yml +++ b/.github/actions/replace-version/action.yml @@ -10,4 +10,4 @@ runs: - name: Replace version shell: bash # There isn't a sed command working on all platforms to replace string in a file, so use perl. - run: perl -i -pe's/0.0.0-staging/${{ inputs.version }}/' Cargo.toml + run: perl -i -pe's/0.0.0-dev/${{ inputs.version }}/' Cargo.toml diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 313569b..20c5e75 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -23,12 +23,11 @@ jobs: # aarch64 - { os: macos-11 , target: aarch64-apple-darwin , alias: aarch64-darwin-macos-11 } - { os: macos-12 , target: aarch64-apple-darwin , alias: aarch64-darwin-macos-12 } - - { os: ubuntu-20.04, target: aarch64-unknown-linux-gnu, alias: aarch64-gnu-ubuntu-20.04 } - - { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, alias: aarch64-gnu-ubuntu-22.04 } # amd64 - { os: macos-12 , target: x86_64-apple-darwin , alias: amd64-darwin-macos-unknown } - { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu , alias: amd64-gnu-ubuntu-20.04 } - { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu , alias: amd64-gnu-ubuntu-22.04 } + - { os: ubuntu-22.04, target: x86_64-unknown-linux-musl, alias: amd64-musl-linux-unknown } - { os: windows-2019, target: x86_64-pc-windows-msvc , alias: amd64-msvc-windows-2019 } - { os: windows-2022, target: x86_64-pc-windows-msvc , alias: amd64-msvc-windows-2022 } @@ -38,7 +37,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - name: Setup rust toolchain + - name: Setup Rust toolchain uses: actions-rs/toolchain@v1 with: profile: minimal @@ -46,7 +45,7 @@ jobs: toolchain: nightly-2023-09-06 components: rustfmt, clippy - - name: Show rust toolchain version + - name: Show Rust toolchain version shell: bash run: | cargo -V @@ -55,16 +54,16 @@ jobs: rustc -V - name: Setup musl-tools - if: runner.os == 'Linux' + if: matrix.targets.target == 'x86_64-unknown-linux-musl' shell: bash - run: sudo apt install musl-tools + run: sudo apt -y install musl-tools - name: Add target uses: ./.github/actions/add-target with: target: ${{ matrix.targets.target }} - - name: Setup rust cache + - name: Setup Rust cache uses: Swatinem/rust-cache@v2 with: prefix-key: ${{ matrix.targets.alias }} diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index e8fa040..a3e5b00 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -17,12 +17,11 @@ jobs: # aarch64 - { os: macos-11 , target: aarch64-apple-darwin , alias: aarch64-darwin-macos-11 } - { os: macos-12 , target: aarch64-apple-darwin , alias: aarch64-darwin-macos-12 } - - { os: ubuntu-20.04, target: aarch64-unknown-linux-gnu, alias: aarch64-gnu-ubuntu-20.04 } - - { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, alias: aarch64-gnu-ubuntu-22.04 } # amd64 - { os: macos-12 , target: x86_64-apple-darwin , alias: amd64-darwin-macos-unknown } - { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu , alias: amd64-gnu-ubuntu-20.04 } - { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu , alias: amd64-gnu-ubuntu-22.04 } + - { os: ubuntu-22.04, target: x86_64-unknown-linux-musl, alias: amd64-musl-linux-unknown } - { os: windows-2019, target: x86_64-pc-windows-msvc , alias: amd64-msvc-windows-2019 } - { os: windows-2022, target: x86_64-pc-windows-msvc , alias: amd64-msvc-windows-2022 } @@ -32,7 +31,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - name: Setup rust toolchain + - name: Setup Rust toolchain uses: actions-rs/toolchain@v1 with: profile: minimal @@ -41,16 +40,16 @@ jobs: components: rustfmt, clippy - name: Setup musl-tools - if: runner.os == 'Linux' + if: matrix.targets.target == 'x86_64-unknown-linux-musl' shell: bash - run: sudo apt install musl-tools + run: sudo apt -y install musl-tools - name: Add target uses: ./.github/actions/add-target with: target: ${{ matrix.targets.target }} - - name: Setup rust cache + - name: Setup Rust cache uses: Swatinem/rust-cache@v2 with: prefix-key: ${{ matrix.targets.alias }} diff --git a/Cargo.toml b/Cargo.toml index 9d22755..ab00ff3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cnb" # WRN: Version will be updated by CI while create a tag, NERVER change this. -version = "0.0.0-staging" +version = "0.0.0-dev" edition = "2021" description = "Cnblogs' command line tool" license = "MIT"