Skip to content

Commit

Permalink
chore(deps): bump dependencies + clap3 migration (#101)
Browse files Browse the repository at this point in the history
* feat(deb): migrate to prebuild deb builder
* chore(deps): bump dependencies + clap3 migration
* feat(ci): decouple artifacts building from deployment
  • Loading branch information
sassman committed Feb 3, 2022
1 parent 39e7560 commit 4a97b07
Show file tree
Hide file tree
Showing 9 changed files with 215 additions and 176 deletions.
3 changes: 0 additions & 3 deletions .deb/Dockerfile

This file was deleted.

5 changes: 3 additions & 2 deletions .deb/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
deb:
docker build -t rust-deb-build - < ${ROOT_DIR}/Dockerfile
docker run --rm -it -v ${ROOT_DIR}/..:/usr/src/app -w /usr/src/app rust-deb-build cargo deb
docker run --rm -v ${ROOT_DIR}/..:/usr/src/app \
-w /usr/src/app \
5422m4n/rust-deb-builder:1.57.0
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ jobs:
strategy:
fail-fast: false
matrix:
# version: [ 'macos-11.0', 'macos-10.15', 'macos-10.14', 'ubuntu-latest']
version: [ 'macos-latest', 'ubuntu-latest']
rust: [ nightly, stable ]
runs-on: ${{ matrix.version }}
Expand All @@ -84,7 +83,7 @@ jobs:
run: cargo test --all --locked -- -Z unstable-options

pkg-deb:
name: binaray package .deb
name: binary package .deb
needs: check
runs-on: ubuntu-latest
steps:
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,3 @@ jobs:
body: ${{ steps.changelog_reader.outputs.changes }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/x86_64-unknown-linux-musl/debian/t-rec*.deb
asset_name: t-rec-${{ steps.tag_name.outputs.current_version }}-amd64-static.deb
asset_content_type: application/vnd.debian.binary-package

# https://github.com/mislav/bump-homebrew-formula-action
publish-to-brew:
name: post / homebrew
needs: publish
runs-on: macos-latest
steps:
- uses: mislav/bump-homebrew-formula-action@v1
with:
formula-name: t-rec
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
102 changes: 102 additions & 0 deletions .github/workflows/release-binary-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Release Binary Assets
on:
release:
types:
- published
jobs:
# https://github.com/mislav/bump-homebrew-formula-action
publish-to-brew:
name: post / homebrew
runs-on: macos-latest
steps:
- uses: mislav/bump-homebrew-formula-action@v1
with:
formula-name: t-rec
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}

release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
cross: true
binName: t-rec
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
cross: true
binName: t-rec
- target: x86_64-apple-darwin
os: macos-latest
cross: false
binName: t-rec
steps:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
use-cross: ${{ matrix.cross }}
args: --release --target=${{ matrix.target }}
- name: Smoke Test
uses: actions-rs/cargo@v1
with:
command: run
use-cross: ${{ matrix.cross }}
args: --release --target=${{ matrix.target }} -- --help
- name: Create Archive
id: archive
shell: bash
env:
TARGET: ${{ matrix.target }}
TAG: ${{ github.event.release.tag_name }}
run: |
filename="t-rec-$TAG-$TARGET.tar.gz"
tar -czvf "$filename" README.md LICENSE -C "target/$TARGET/release" "${{ matrix.binName }}"
echo "::set-output name=filename::$filename"
- name: Upload Archive
uses: ncipollo/release-action@v1.8.7
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: ${{ steps.archive.outputs.filename }}
artifactContentType: application/octet-stream
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true

pkg-deb:
name: binary package .deb
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build .deb file
uses: sassman/rust-deb-builder@v1.57.0
- name: Archive deb artifact
uses: actions/upload-artifact@v2
with:
name: t-rec-amd64-static.deb
path: target/x86_64-unknown-linux-musl/debian/t-rec*.deb
- name: upload deb file
uses: ncipollo/release-action@v1.8.7
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: target/x86_64-unknown-linux-musl/debian/t-rec*.deb
artifactContentType: application/octet-stream
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true

Loading

0 comments on commit 4a97b07

Please sign in to comment.