chore: rm unused dev dep and add back port check (#72) #63
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: CI | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
check-versions: | |
runs-on: ubuntu-latest | |
outputs: | |
should_release: ${{ steps.comp_ver.outputs.should_release }} | |
current_version: ${{ steps.comp_ver.outputs.current_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cardinalby/git-get-release-action@1.2.5 | |
id: check_rel | |
name: get latest release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
latest: true | |
prerelease: false | |
doNotFailIfNotFound: true | |
- name: compare versions | |
uses: mmta/should-release-action@v1.0.0 | |
id: comp_ver | |
with: | |
file_path: Cargo.toml | |
release_tag: ${{ steps.check_rel.outputs.tag_name }} | |
publish-new-version: | |
needs: check-versions | |
if: needs.check-versions.outputs.should_release == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: login to dockerhub | |
uses: "docker/login-action@v2" | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: build and push default image | |
run: | | |
./scripts/dockerbuild.sh defenxor/dsiem-rs wolfi push | |
- name: extract binaries | |
uses: shrink/actions-docker-extract@v3 | |
with: | |
image: defenxor/dsiem-rs:${{ needs.check-versions.outputs.current_version }}-wolfi | |
path: /dsiem/. | |
destination: dsiem | |
- name: zip binaries | |
run: | | |
rm -rf dsiem/configs && mv dsiem/configs-dist dsiem/configs | |
cp LICENSE dsiem/LICENSE | |
cp README.md dsiem/README.md | |
zip -9 -r dsiem-server_linux_x86_64.zip dsiem | |
sha256sum dsiem-server_linux_x86_64.zip > dsiem-server_linux_x86_64.zip.sha256.txt | |
- name: create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dsiem-server_linux_x86_64.zip | |
dsiem-server_linux_x86_64.zip.sha256.txt | |
generate_release_notes: true | |
tag_name: v${{ needs.check-versions.outputs.current_version }} | |
draft: false | |
prerelease: false | |