mirror of
https://github.com/adriankumpf/tesla_auth.git
synced 2026-02-27 09:54:03 +08:00
ee71789bd7
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
76 lines
2.5 KiB
YAML
76 lines
2.5 KiB
YAML
name: CD
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
jobs:
|
|
publish:
|
|
name: Publishing for ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
rust: [stable]
|
|
include:
|
|
- os: macos-latest
|
|
artifact_prefix: macos
|
|
target: x86_64-apple-darwin
|
|
binary_postfix: ""
|
|
- os: ubuntu-latest
|
|
artifact_prefix: linux
|
|
target: x86_64-unknown-linux-gnu
|
|
binary_postfix: ""
|
|
- os: windows-latest
|
|
artifact_prefix: windows
|
|
target: x86_64-pc-windows-msvc
|
|
binary_postfix: ".exe"
|
|
|
|
steps:
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Installing needed Windows dependencies
|
|
if: matrix.os == 'windows-latest'
|
|
shell: pwsh
|
|
run: |
|
|
Invoke-WebRequest https://go.microsoft.com/fwlink/p/?LinkId=2124703 -OutFile installwebview.exe -UseBasicParsing
|
|
cmd /C start /wait installwebview.exe /silent /install
|
|
- name: Installing needed Ubuntu dependencies
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y webkit2gtk-4.1 libxdo-dev
|
|
- name: Checking out sources
|
|
uses: actions/checkout@v4
|
|
- name: Running cargo build
|
|
run: cargo build --release --target ${{ matrix.target }}
|
|
- name: Packaging final binary
|
|
shell: bash
|
|
run: |
|
|
cd target/${{ matrix.target }}/release
|
|
|
|
BINARY_NAME=tesla_auth${{ matrix.binary_postfix }}
|
|
RELEASE_NAME=tesla-auth-${{ matrix.artifact_prefix }}
|
|
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME
|
|
|
|
if [[ ${{ runner.os }} == 'Windows' ]]; then
|
|
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
|
|
else
|
|
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
|
|
fi
|
|
- name: Releasing assets
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
target/${{ matrix.target }}/release/tesla-auth-${{ matrix.artifact_prefix }}.tar.gz
|
|
target/${{ matrix.target }}/release/tesla-auth-${{ matrix.artifact_prefix }}.sha256
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|