adde minimum supported rust version to 1.85 #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copied from ripgrep | |
name: release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
create_release: | |
name: create_release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the release version from the tag | |
if: env.PACKAGE_VERSION == '' | |
run: | | |
echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
echo "version is: ${{ env.PACKAGE_VERSION }}" | |
- name: Create GitHub release | |
id: release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.PACKAGE_VERSION }} | |
name: ${{ env.PACKAGE_VERSION }} | |
draft: false | |
prerelease: false | |
generate_release_notes: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
package_version: ${{ env.PACKAGE_VERSION }} | |
build: | |
name: build | |
needs: [ create_release ] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [ x86_64-unknown-linux-musl, aarch64-unknown-linux-musl ] | |
include: | |
- target: x86_64-unknown-linux-musl | |
strip: strip | |
- target: aarch64-unknown-linux-musl | |
strip: aarch64-linux-musl-strip | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: ${{ matrix.target }} | |
- name: Install cross compile toolchains | |
if: ${{ matrix.target == 'aarch64-unknown-linux-musl' }} | |
run: | | |
curl -O https://musl.cc/aarch64-linux-musl-cross.tgz | |
tar xzf aarch64-linux-musl-cross.tgz | |
sudo cp -R aarch64-linux-musl-cross/* /usr | |
- name: Build target | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --release --locked --target ${{ matrix.target }} | |
- name: Build archive | |
shell: bash | |
run: | | |
"${{ matrix.strip }}" "target/${{ matrix.target }}/release/rate_mirrors" | |
staging="rate-mirrors-${{ needs.create_release.outputs.package_version }}-${{ matrix.target }}" | |
mkdir -p "$staging" | |
cp LICENSE "$staging/" | |
cp "target/${{ matrix.target }}/release/rate_mirrors" "$staging/" | |
tar czf "$staging.tar.gz" "$staging" | |
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV | |
- name: Upload release archive | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.create_release.outputs.package_version }} | |
files: ${{ env.ASSET }} | |
token: ${{ secrets.GITHUB_TOKEN }} |