Add release pipeline
This commit is contained in:
73
.github/workflows/release.yml
vendored
Normal file
73
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
name: CD Native
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ created ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform: [ ubuntu-latest, macos-latest, windows-latest ]
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy
|
||||||
|
- uses: actions-rs/cargo@v1.0.1
|
||||||
|
name: Check format
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: --all -- --check
|
||||||
|
- uses: actions-rs/cargo@v1.0.1
|
||||||
|
name: Run clippy
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all-targets --locked -- -D warnings
|
||||||
|
- uses: actions-rs/cargo@v1.0.1
|
||||||
|
name: Run clippy (All features)
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all-targets --locked --all-features -- -D warnings
|
||||||
|
- uses: actions-rs/cargo@v1.0.1
|
||||||
|
name: Run tests
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
- uses: actions-rs/cargo@v1.0.1
|
||||||
|
name: Build
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --release --all-features
|
||||||
|
- name: Rename Release (Unix)
|
||||||
|
run: |
|
||||||
|
cargo install default-target
|
||||||
|
mkdir assets
|
||||||
|
FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target)
|
||||||
|
mv target/release/topgrade assets
|
||||||
|
cd assets
|
||||||
|
tar --format=ustar -czf $FILENAME.tar.gz topgrade
|
||||||
|
rm topgrade
|
||||||
|
ls .
|
||||||
|
if: ${{ matrix.platform != 'windows-latest' }}
|
||||||
|
shell: bash
|
||||||
|
- name: Rename Release (Windows)
|
||||||
|
run: |
|
||||||
|
cargo install default-target
|
||||||
|
mkdir assets
|
||||||
|
FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target)
|
||||||
|
mv target/release/topgrade.exe assets/topgrade.exe
|
||||||
|
cd assets
|
||||||
|
powershell Compress-Archive -Path * -Destination ${FILENAME}.zip
|
||||||
|
rm topgrade.exe
|
||||||
|
ls .
|
||||||
|
if: ${{ matrix.platform == 'windows-latest' }}
|
||||||
|
shell: bash
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: assets/*
|
||||||
Reference in New Issue
Block a user