From 01b483d7169be7bc14c37baaf5fbe52542ff0ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=B1=82=E5=9C=A3=E5=89=91?= Date: Sat, 11 Nov 2023 10:19:59 +0800 Subject: [PATCH 1/6] feat(config): add github releases flow --- .github/workflows/build_release.yaml | 66 ++++++++++++++++++++++++++++ .idea/workspace.xml | 27 ++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/workflows/build_release.yaml create mode 100644 .idea/workspace.xml diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml new file mode 100644 index 0000000..f563992 --- /dev/null +++ b/.github/workflows/build_release.yaml @@ -0,0 +1,66 @@ +name: Rust Build and Release + +on: + push: + branches: [ main ] + tags: + - 'v*' + +jobs: + build: + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - os: ubuntu-20.04 + rust_target: x86_64-unknown-linux-gnu + ext: '' + args: '' + - os: macos-latest + rust_target: x86_64-apple-darwin + ext: '' + args: '' + - os: macos-latest + rust_target: aarch64-apple-darwin + ext: '' + args: '' + - os: windows-latest + rust_target: x86_64-pc-windows-msvc + ext: '.exe' + args: '' + - os: windows-latest + rust_target: aarch64-pc-windows-msvc + ext: '.exe' + args: '--no-default-features --features native-tls-vendored' + + steps: + - uses: actions/checkout@v2 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + - name: Build release + run: cargo build --release + - name: Create release tarball + run: tar czvf commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz -C target/release commitlint${{ matrix.config.ext }} + + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + files: | + commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} + diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..11b9132 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + \ No newline at end of file From c4d97b1d5623e93bc833e37ceb4ee0a51f31226a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=B1=82=E5=9C=A3=E5=89=91?= Date: Mon, 13 Nov 2023 10:42:09 +0800 Subject: [PATCH 2/6] Delete .idea directory --- .idea/workspace.xml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 11b9132..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file From ea39a076aa74373340a623331bece6323fa08c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=B1=82=E5=9C=A3=E5=89=91?= Date: Sat, 2 Dec 2023 21:28:00 +0800 Subject: [PATCH 3/6] Update .github/workflows/build_release.yaml Co-authored-by: KeisukeYamashita <19yamashita15@gmail.com> --- .github/workflows/build_release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml index f563992..8b51cf9 100644 --- a/.github/workflows/build_release.yaml +++ b/.github/workflows/build_release.yaml @@ -1,4 +1,4 @@ -name: Rust Build and Release +name: Release on: push: From 220c73923f9361c600b4ed887e2014bed5ecd3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=B1=82=E5=9C=A3=E5=89=91?= Date: Sat, 2 Dec 2023 21:28:09 +0800 Subject: [PATCH 4/6] Update .github/workflows/build_release.yaml Co-authored-by: KeisukeYamashita <19yamashita15@gmail.com> --- .github/workflows/build_release.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml index 8b51cf9..6956a69 100644 --- a/.github/workflows/build_release.yaml +++ b/.github/workflows/build_release.yaml @@ -2,7 +2,6 @@ name: Release on: push: - branches: [ main ] tags: - 'v*' From 54484686cd2d7dc86fcd215100a0481096455bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=B1=82=E5=9C=A3=E5=89=91?= Date: Sat, 2 Dec 2023 21:28:17 +0800 Subject: [PATCH 5/6] Update .github/workflows/build_release.yaml Co-authored-by: KeisukeYamashita <19yamashita15@gmail.com> --- .github/workflows/build_release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml index 6956a69..ab69a87 100644 --- a/.github/workflows/build_release.yaml +++ b/.github/workflows/build_release.yaml @@ -34,7 +34,7 @@ jobs: args: '--no-default-features --features native-tls-vendored' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Rust uses: actions-rs/toolchain@v1 From c35bb3c3c7115feea5a3c9324b1d132779e52140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=B1=82=E5=9C=A3=E5=89=91?= Date: Sat, 2 Dec 2023 21:29:13 +0800 Subject: [PATCH 6/6] Update .github/workflows/build_release.yaml Co-authored-by: KeisukeYamashita <19yamashita15@gmail.com> --- .github/workflows/build_release.yaml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml index ab69a87..b3a894d 100644 --- a/.github/workflows/build_release.yaml +++ b/.github/workflows/build_release.yaml @@ -36,27 +36,21 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Rust - uses: actions-rs/toolchain@v1 + - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - - name: Build - run: cargo build --verbose + - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - run: cargo test --verbose - - name: Build release - run: cargo build --release - - name: Create release tarball - run: tar czvf commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz -C target/release commitlint${{ matrix.config.ext }} + - run: cargo build --release + + - run: tar czvf commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz -C target/release commitlint${{ matrix.config.ext }} - - name: Release - if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v1 with: files: | commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz