Skip to content

Commit f38d54d

Browse files
Merge pull request #296 from apecloud/fix/redis_two_way
update github workflows
2 parents 46ccb26 + de51510 commit f38d54d

File tree

7 files changed

+33
-152
lines changed

7 files changed

+33
-152
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/audit.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Release
1+
name: Build and release
22

33
on:
44
workflow_dispatch:
@@ -10,11 +10,11 @@ on:
1010
tag_name:
1111
required: true
1212
type: string
13-
default: latest
13+
default:
1414
targets:
1515
description: 'JSON array of target platforms to build [{"os": "ubuntu-latest", "target": "x86_64-unknown-linux-gnu"}, ...]'
1616
required: true
17-
default: '[{"os": "ubuntu-latest", "target": "x86_64-unknown-linux-gnu"}, {"os": "ubuntu-latest", "target": "aarch64-unknown-linux-gnu"}, {"os": "windows-latest", "target": "x86_64-pc-windows-msvc"}, {"os": "macos-latest", "target": "x86_64-apple-darwin"}]'
17+
default: '[{"os": "ubuntu-latest", "target": "x86_64-unknown-linux-gnu"}, {"os": "ubuntu-latest", "target": "aarch64-unknown-linux-gnu"}, {"os": "macos-latest", "target": "x86_64-apple-darwin"}]'
1818

1919
jobs:
2020
build:
@@ -32,20 +32,6 @@ jobs:
3232
with:
3333
ref: ${{ inputs.branch }}
3434

35-
- name: Set up Rust toolchain
36-
uses: dtolnay/rust-toolchain@stable
37-
38-
- name: Install target
39-
run: rustup target add ${{ matrix.target }}
40-
41-
- name: Build binary
42-
run: cargo build --release --target=${{ matrix.target }}
43-
44-
- name: Create release artifact
45-
run: |
46-
mkdir -p artifacts
47-
cp target/${{ matrix.target }}/release/dt-main artifacts/ape-dts
48-
4935
- name: Create Release
5036
id: create_release
5137
uses: softprops/action-gh-release@v1
@@ -56,11 +42,38 @@ jobs:
5642
env:
5743
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5844

45+
- name: Set up Rust toolchain
46+
uses: dtolnay/rust-toolchain@stable
47+
48+
# Build linux targets by cross, otherwise there may be runtime errors when running on other linux versions:
49+
# ./ape-dts: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by ./ape-dts)
50+
# ./ape-dts: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by ./ape-dts)
51+
- name: Cross build
52+
if: matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'x86_64-pc-windows-gnu'
53+
run: |
54+
cargo install cross
55+
cross build --release --target=${{ matrix.target }}
56+
57+
- name: Local build
58+
if: matrix.target == 'x86_64-apple-darwin'
59+
run: |
60+
rustup target add ${{ matrix.target }}
61+
cargo build --release --target=${{ matrix.target }}
62+
63+
- name: Create release artifact
64+
run: |
65+
mkdir -p artifacts
66+
cp target/${{ matrix.target }}/release/dt-main artifacts/ape-dts
67+
cp log4rs.yaml artifacts/log4rs.yaml
68+
tar -czvf ape-dts-${{ github.run_id }}-${{ matrix.target }}.tar.gz -C artifacts .
69+
5970
- name: Upload Release Asset
6071
id: upload_release_asset
6172
uses: actions/upload-release-asset@v1
6273
with:
6374
upload_url: ${{ steps.create_release.outputs.upload_url }}
64-
asset_path: artifacts/ape-dts
65-
asset_name: ape-dts-${{ github.run_id }}-${{ matrix.target }}
66-
asset_content_type: application/octet-stream
75+
asset_path: ape-dts-${{ github.run_id }}-${{ matrix.target }}.tar.gz
76+
asset_name: ape-dts-${{ github.run_id }}-${{ matrix.target }}.tar.gz
77+
asset_content_type: application/gzip
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cd.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)