diff options
author | sommerfeld <sommerfeld@sommerfeld.dev> | 2024-04-22 03:11:40 +0100 |
---|---|---|
committer | sommerfeld <sommerfeld@sommerfeld.dev> | 2024-04-22 05:01:47 +0100 |
commit | 3a5b3a2fc85855b3b458f25692aba5323d47dafa (patch) | |
tree | 90e3286bc3a7dd381089aeeaf3a9ff64ec59cedc | |
parent | 9a95d297678c4ba9e33f22c4e8e17173ce393878 (diff) | |
download | sentrum-3a5b3a2fc85855b3b458f25692aba5323d47dafa.tar.gz sentrum-3a5b3a2fc85855b3b458f25692aba5323d47dafa.tar.bz2 sentrum-3a5b3a2fc85855b3b458f25692aba5323d47dafa.zip |
Revamp release job
-rw-r--r-- | .github/workflows/build.yml | 37 | ||||
-rw-r--r-- | .github/workflows/release.yml | 51 |
2 files changed, 51 insertions, 37 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 0220563..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build -on: - push: - tags: - - '*' -jobs: - build: - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - uses: Swatinem/rust-cache@v2 - - run: cargo build --release - - if: matrix.os == 'windows-latest' - uses: actions/upload-artifact@v3 - with: - path: target/release/sentrum.exe - name: sentrum.exe - - if: matrix.os == 'ubuntu-latest' - uses: actions/upload-artifact@v3 - with: - path: target/release/sentrum* - name: sentrum_linux - - if: matrix.os == 'macos-latest' - uses: actions/upload-artifact@v3 - with: - path: target/release/sentrum* - name: sentrum_macos diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cfa05c2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Release +on: + push: + tags: + - v* +jobs: + release: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + bin: sentrum + name: sentrum-linux-x86_64.tar.gz + - os: windows-latest + bin: sentrum.exe + name: sentrum-windows-x86_64.zip + - os: macOS-latest + bin: sentrum + name: sentrum-darwin-x86_64.tar.gz + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + - uses: Swatinem/rust-cache@v2 + - run: cargo build --release + - name: Package + shell: bash + run: | + strip target/release/${{ matrix.bin }} + cd target/release + if [[ "${{ matrix.os }}" == "windows-latest" ]] + then + 7z a ../../${{ matrix.name }} ${{ matrix.bin }} + else + tar czvf ../../${{ matrix.name }} ${{ matrix.bin }} + fi + cd - + - name: Publish + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + files: | + sentrum-* + sentrum.sample.toml + contrib/sentrum.service + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |