use GithubConfig to wrap token and discord webhook #8
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: Release | |
on: | |
push: | |
branches: [ "main" ] | |
tags: 'v*' | |
paths-ignore: | |
- 'doc/**' | |
- '.github/**' | |
workflow_dispatch: | |
jobs: | |
build_test_and_bundle: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, ubuntu-20.04, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup rust stable | |
run: curl https://sh.rustup.rs -sSf | sh -s -- -y | |
- name: unit tests | |
run: cargo test --all --release | |
- name: bundle | |
shell: bash | |
run: | | |
mkdir Pulse | |
cp target/release/pulse Pulse/pulse-${{ matrix.os }} | |
cp LICENSE Pulse/ | |
- name: upload bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }} | |
path: Pulse | |
release: | |
needs: [build_test_and_bundle] | |
if: github.ref_type == 'tag' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: get linux build | |
uses: actions/download-artifact@v3 | |
with: | |
name: ubuntu-latest | |
- name: get windows build | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-latest | |
- name: get macos build | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-latest | |
- name: pack | |
run: | | |
mkdir linux windows macos | |
ls | |
mv pulse-ubuntu-latest pulse | |
chmod +x pulse | |
tar cvpfz linux-x86_64.tar.gz pulse LICENSE | |
mv pulse-windows-latest.exe pulse.exe | |
chmod +x pulse.exe | |
zip windows.zip pulse.exe LICENSE | |
mv pulse-macos-latest pulse | |
chmod +x pulse | |
tar cvpfz macOS.tar.gz pulse LICENSE | |
# https://github.com/softprops/action-gh-release | |
- name: release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
prerelease: true | |
name: "release-${{ github.ref_name }}" | |
tag_name: ${{ github.ref }} | |
files: | | |
linux-x86_64.tar.gz | |
windows.zip | |
macOS.tar.gz |