fix build.rs #21
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
name: CD | |
on: | |
push: | |
tags: | |
- v* | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
platform: [windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install cargo-make | |
run: cargo install cargo-make | |
- name: Cache Cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-registry- | |
- name: Cache Cargo build | |
uses: actions/cache@v2 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-build- | |
- name: Decrypt Environmebt | |
run: | | |
echo "${{ secrets.ENV }}" > .env | |
- name: Build project | |
run: cargo make release | |
- name: Upload Release Asset | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hts-connector-windows-latest | |
path: ./target/release/hts_connector.exe | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: hts-connector-windows-latest | |
path: . | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Compress Asset | |
run: zip hts-connector.zip hts_connector.exe | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./hts-connector.zip | |
asset_name: hts-connector.zip | |
asset_content_type: application/octet-stream |