Skip to content

Commit e1ad40a

Browse files
committed
remove rkv, run cross with bash in release.yml
1 parent 5281839 commit e1ad40a

File tree

3 files changed

+119
-266
lines changed

3 files changed

+119
-266
lines changed

.github/workflows/release.yml

Lines changed: 119 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ on:
1818
# branches:
1919
# - ag/release
2020
tags:
21-
- 'v[0-9]+.[0-9]+.[0-9]+*'
21+
- "v[0-9]+.[0-9]+.[0-9]+*"
2222
jobs:
2323
create-release:
2424
name: create-release
2525
runs-on: ubuntu-latest
2626
# env:
27-
# Set to force version number, e.g., when no tag exists.
28-
# RG_VERSION: TEST-0.0.0
27+
# Set to force version number, e.g., when no tag exists.
28+
# RG_VERSION: TEST-0.0.0
2929
steps:
3030
- name: Create artifacts directory
3131
run: mkdir artifacts
@@ -62,7 +62,7 @@ jobs:
6262

6363
build-release:
6464
name: build-release
65-
needs: ['create-release']
65+
needs: ["create-release"]
6666
runs-on: ${{ matrix.os }}
6767
env:
6868
# For some builds, we use cross to test on 32-bit and big-endian
@@ -78,124 +78,124 @@ jobs:
7878
matrix:
7979
build: [linux, linux-arm, macos, win-msvc]
8080
include:
81-
- build: linux
82-
os: ubuntu-18.04
83-
rust: nightly
84-
target: x86_64-unknown-linux-musl
85-
- build: linux-arm
86-
os: ubuntu-18.04
87-
rust: nightly
88-
target: arm-unknown-linux-gnueabihf
89-
- build: macos
90-
os: macos-latest
91-
rust: nightly
92-
target: x86_64-apple-darwin
93-
- build: win-msvc
94-
os: windows-2019
95-
rust: nightly
96-
target: x86_64-pc-windows-msvc
81+
- build: linux
82+
os: ubuntu-18.04
83+
rust: nightly
84+
target: x86_64-unknown-linux-musl
85+
- build: linux-arm
86+
os: ubuntu-18.04
87+
rust: nightly
88+
target: arm-unknown-linux-gnueabihf
89+
- build: macos
90+
os: macos-latest
91+
rust: nightly
92+
target: x86_64-apple-darwin
93+
- build: win-msvc
94+
os: windows-2019
95+
rust: nightly
96+
target: x86_64-pc-windows-msvc
9797
#- build: win-gnu
9898
# os: windows-2019
9999
# rust: nightly-x86_64-gnu
100100
# target: x86_64-pc-windows-gnu
101101

102102
steps:
103-
- name: Checkout repository
104-
uses: actions/checkout@v2
105-
with:
106-
fetch-depth: 1
107-
108-
- name: Install packages (Ubuntu)
109-
if: matrix.os == 'ubuntu-18.04'
110-
run: |
111-
ci/ubuntu-install-packages
112-
113-
- name: Install packages (macOS)
114-
if: matrix.os == 'macos-latest'
115-
run: |
116-
ci/macos-install-packages
117-
118-
- name: Install Rust
119-
uses: actions-rs/toolchain@v1
120-
with:
121-
toolchain: ${{ matrix.rust }}
122-
profile: minimal
123-
override: true
124-
target: ${{ matrix.target }}
125-
126-
- name: Use Cross
127-
# if: matrix.os != 'windows-2019'
128-
run: |
129-
cargo install cross
130-
echo "CARGO=cross" >> $GITHUB_ENV
131-
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
132-
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
133-
134-
- name: Show command used for Cargo
135-
run: |
136-
echo "cargo command is: ${{ env.CARGO }}"
137-
echo "target flag is: ${{ env.TARGET_FLAGS }}"
138-
echo "target dir is: ${{ env.TARGET_DIR }}"
139-
140-
- name: Get release download URL
141-
uses: actions/download-artifact@v1
142-
with:
143-
name: artifacts
144-
path: artifacts
145-
146-
- name: Set release upload URL and release version
147-
shell: bash
148-
run: |
149-
echo "RELEASE_UPLOAD_URL=$(cat artifacts/release-upload-url)" >> $GITHUB_ENV
150-
echo "release upload url: $RELEASE_UPLOAD_URL"
151-
echo "RELEASE_VERSION=$(cat artifacts/release-version)" >> $GITHUB_ENV
152-
echo "release version: $RELEASE_VERSION"
153-
154-
- name: Build release binary
155-
run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}
156-
157-
- name: Strip release binary (linux and macos)
158-
if: matrix.build == 'linux' || matrix.build == 'macos'
159-
run: |
160-
strip "target/${{ matrix.target }}/release/rga" "target/${{ matrix.target }}/release/rga-preproc"
161-
162-
- name: Strip release binary (arm)
163-
if: matrix.build == 'linux-arm'
164-
run: |
165-
docker run --rm -v \
166-
"$PWD/target:/target:Z" \
167-
rustembedded/cross:arm-unknown-linux-gnueabihf \
168-
arm-linux-gnueabihf-strip \
169-
/target/arm-unknown-linux-gnueabihf/release/rga \
170-
/target/arm-unknown-linux-gnueabihf/release/rga-preproc
171-
172-
- name: Build archive
173-
shell: bash
174-
run: |
175-
staging="ripgrep_all-${{ env.RELEASE_VERSION }}-${{ matrix.target }}"
176-
mkdir -p "$staging"/doc
177-
178-
cp {README.md,LICENSE.md} "$staging/"
179-
cp CHANGELOG.md "$staging/doc/"
180-
181-
if [ "${{ matrix.os }}" = "windows-2019" ]; then
182-
cp "target/${{ matrix.target }}/release/rga.exe" "$staging/"
183-
cp "target/${{ matrix.target }}/release/rga-preproc.exe" "$staging/"
184-
7z a "$staging.zip" "$staging"
185-
echo "ASSET=$staging.zip" >> $GITHUB_ENV
186-
else
187-
cp "target/${{ matrix.target }}/release/rga" "$staging/"
188-
cp "target/${{ matrix.target }}/release/rga-preproc" "$staging/"
189-
tar czf "$staging.tar.gz" "$staging"
190-
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
191-
fi
192-
193-
- name: Upload release archive
194-
uses: actions/[email protected]
195-
env:
196-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197-
with:
198-
upload_url: ${{ env.RELEASE_UPLOAD_URL }}
199-
asset_path: ${{ env.ASSET }}
200-
asset_name: ${{ env.ASSET }}
201-
asset_content_type: application/octet-stream
103+
- name: Checkout repository
104+
uses: actions/checkout@v2
105+
with:
106+
fetch-depth: 1
107+
108+
- name: Install packages (Ubuntu)
109+
if: matrix.os == 'ubuntu-18.04'
110+
run: |
111+
ci/ubuntu-install-packages
112+
113+
- name: Install packages (macOS)
114+
if: matrix.os == 'macos-latest'
115+
run: |
116+
ci/macos-install-packages
117+
118+
- name: Install Rust
119+
uses: actions-rs/toolchain@v1
120+
with:
121+
toolchain: ${{ matrix.rust }}
122+
profile: minimal
123+
override: true
124+
target: ${{ matrix.target }}
125+
126+
- name: Use Cross
127+
shell: bash
128+
run: |
129+
cargo install cross
130+
echo "CARGO=cross" >> $GITHUB_ENV
131+
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
132+
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
133+
134+
- name: Show command used for Cargo
135+
run: |
136+
echo "cargo command is: ${{ env.CARGO }}"
137+
echo "target flag is: ${{ env.TARGET_FLAGS }}"
138+
echo "target dir is: ${{ env.TARGET_DIR }}"
139+
140+
- name: Get release download URL
141+
uses: actions/download-artifact@v1
142+
with:
143+
name: artifacts
144+
path: artifacts
145+
146+
- name: Set release upload URL and release version
147+
shell: bash
148+
run: |
149+
echo "RELEASE_UPLOAD_URL=$(cat artifacts/release-upload-url)" >> $GITHUB_ENV
150+
echo "release upload url: $RELEASE_UPLOAD_URL"
151+
echo "RELEASE_VERSION=$(cat artifacts/release-version)" >> $GITHUB_ENV
152+
echo "release version: $RELEASE_VERSION"
153+
154+
- name: Build release binary
155+
run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}
156+
157+
- name: Strip release binary (linux and macos)
158+
if: matrix.build == 'linux' || matrix.build == 'macos'
159+
run: |
160+
strip "target/${{ matrix.target }}/release/rga" "target/${{ matrix.target }}/release/rga-preproc"
161+
162+
- name: Strip release binary (arm)
163+
if: matrix.build == 'linux-arm'
164+
run: |
165+
docker run --rm -v \
166+
"$PWD/target:/target:Z" \
167+
rustembedded/cross:arm-unknown-linux-gnueabihf \
168+
arm-linux-gnueabihf-strip \
169+
/target/arm-unknown-linux-gnueabihf/release/rga \
170+
/target/arm-unknown-linux-gnueabihf/release/rga-preproc
171+
172+
- name: Build archive
173+
shell: bash
174+
run: |
175+
staging="ripgrep_all-${{ env.RELEASE_VERSION }}-${{ matrix.target }}"
176+
mkdir -p "$staging"/doc
177+
178+
cp {README.md,LICENSE.md} "$staging/"
179+
cp CHANGELOG.md "$staging/doc/"
180+
181+
if [ "${{ matrix.os }}" = "windows-2019" ]; then
182+
cp "target/${{ matrix.target }}/release/rga.exe" "$staging/"
183+
cp "target/${{ matrix.target }}/release/rga-preproc.exe" "$staging/"
184+
7z a "$staging.zip" "$staging"
185+
echo "ASSET=$staging.zip" >> $GITHUB_ENV
186+
else
187+
cp "target/${{ matrix.target }}/release/rga" "$staging/"
188+
cp "target/${{ matrix.target }}/release/rga-preproc" "$staging/"
189+
tar czf "$staging.tar.gz" "$staging"
190+
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
191+
fi
192+
193+
- name: Upload release archive
194+
uses: actions/[email protected]
195+
env:
196+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197+
with:
198+
upload_url: ${{ env.RELEASE_UPLOAD_URL }}
199+
asset_path: ${{ env.ASSET }}
200+
asset_name: ${{ env.ASSET }}
201+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)