Skip to content

Bump version 2.0.3 and update CHANGELOG.md #8

Bump version 2.0.3 and update CHANGELOG.md

Bump version 2.0.3 and update CHANGELOG.md #8

Workflow file for this run

# This Github workflow will create a new release when a tag is pushed,
# then it will build the binary and it will add it to the release assets
# in a tar.gz archive along with other components.
#
# Reference: https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
create-release:
name: create-release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
version: ${{ github.ref_name }}
steps:
- name: Create Github Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
build-release:
name: build-release
needs: ["create-release"]
runs-on: ${{ matrix.os }}
env:
TARGET_DIR: ./target
# Emit backtraces on panics.
RUST_BACKTRACE: 1
strategy:
matrix:
build: [x86_64-linux-gnu, x86_64-linux-musl, i686-linux-gnu, i686-linux-musl, arm-linux-gnueabihf, arm-linux-musleabihf]
include:
- build: x86_64-linux-gnu
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
- build: x86_64-linux-musl
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
- build: i686-linux-gnu
os: ubuntu-latest
rust: stable
target: i686-unknown-linux-gnu
- build: i686-linux-musl
os: ubuntu-latest
rust: stable
target: i686-unknown-linux-musl
- build: arm-linux-gnueabihf
os: ubuntu-latest
rust: stable
target: arm-unknown-linux-gnueabihf
- build: arm-linux-musleabihf
os: ubuntu-latest
rust: stable
target: arm-unknown-linux-musleabihf
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Build Binary
run: cargo build --verbose --release --target ${{ matrix.target }}
- name: Build Archive
shell: bash
run: |
# The foxmakrs-stamp is created in the build.rs script to detect the outdir.
outdir="$(find '${{ env.TARGET_DIR }}' -name foxmarks-stamp -print0 | xargs -0 ls -t | head -n1 | xargs dirname)"
staging="foxmarks-${{ needs.create-release.outputs.version }}-${{ matrix.target }}"
mkdir -p "$staging"/shell_completions "$staging"/man_pages
cp {README.md,LICENSE,CHANGELOG.md} "$staging/"
cp "$outdir"/shell_completions/* "$staging"/shell_completions/
cp "$outdir"/man_pages/* "$staging"/man_pages/
cp "target/${{ matrix.target }}/release/foxmarks" "$staging/"
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
- name: Upload Release Archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream