Jelajahi Sumber

ci: remove hub dispatch, (msi) take release version from git history (#1949)

Co-authored-by: Sebastien Blot <sebastien@crowdsec.net>
mmetc 2 tahun lalu
induk
melakukan
2142f7bb5c

+ 17 - 20
.github/workflows/ci-windows-build-msi.yml

@@ -1,29 +1,26 @@
 name: build-msi (windows)
 
 on:
+  release:
+    types:
+      - prereleased
+  push:
+    branches:
+      - master
+      - releases/**
+    paths:
+      - windows/installer/*.wxs
+      - .github/workflows/ci-windows-build-msi.yml
   pull_request:
     branches:
       - master
       - releases/**
-    paths-ignore:
-      - 'docs/**'
-      - 'mkdocs.yml'
-      - 'README.md'
+    paths:
+      - windows/installer/*.wxs
+      - .github/workflows/ci-windows-build-msi.yml
 
-jobs:
-  get_latest_release:
-    name: get_latest_release
-    runs-on: ubuntu-latest
-    permissions:
-      contents: read
-    steps:
-    - id: get_latest_release
-      uses: cardinalby/git-get-release-action@cedef2faf69cb7c55b285bad07688d04430b7ada
-      env:
-        GITHUB_TOKEN: ${{ github.token }}
-      with:
-        latest: true
 
+jobs:
   build:
     name: Build
     runs-on: windows-2019
@@ -34,9 +31,9 @@ jobs:
         go-version: 1.19
       id: go
     - name: Check out code into the Go module directory
-      uses: actions/checkout@v2
-    - id: set_release_in_env
-      run: echo "BUILD_VERSION=${{ jobs.get_latest_release.outputs.tag_name }}" >> $env:GITHUB_ENV
+      uses: actions/checkout@v3
+      with:
+        fetch-depth: 0
     - name: Build
       run: make windows_installer
     - name: Upload MSI

+ 0 - 22
.github/workflows/dispatch_ci_hub.yaml

@@ -1,22 +0,0 @@
-name: Dispatch to hub when creating pre-release
-
-on:
-  push:
-    # branches to consider in the event; optional, defaults to all
-    branches:
-      - master
-      - releases/**
-
-jobs:
-  dispatch:
-    name: dispatch to hub-tests
-    runs-on: ubuntu-latest
-    steps:
-      - name: Repository Dispatch
-        uses: peter-evans/repository-dispatch@v1
-        if: ${{ github.repository_owner == 'crowdsecurity' }}
-        with:
-          token: ${{ secrets.DISPATCH_TOKEN }}
-          event-type: trigger_ci_hub
-          repository: crowdsecurity/hub
-          client-payload: '{"version": "${{ steps.keydb.outputs.release }}"}'

+ 0 - 34
.github/workflows/dispatch_create_branch_hub.yaml

@@ -1,34 +0,0 @@
-name: Dispatch to hub when creating pre-release
-
-on:
-  release:
-    types:
-      - prereleased
-
-jobs:
-  get_latest_release:
-    name: get_latest_release
-    runs-on: ubuntu-latest
-    permissions:
-      contents: read
-    steps:
-    - id: get_latest_release
-      uses: cardinalby/git-get-release-action@cedef2faf69cb7c55b285bad07688d04430b7ada
-      env:
-        GITHUB_TOKEN: ${{ github.token }}
-      with:
-        latest: true
-        draft: false
-        prerelease: false
-
-  dispatch:
-    name: dispatch to hub-tests
-    runs-on: ubuntu-latest
-    steps:
-      - name: Repository Dispatch
-        uses: peter-evans/repository-dispatch@v1
-        with:
-          token: ${{ secrets.DISPATCH_TOKEN }}
-          event-type: create_branch
-          repository: crowdsecurity/hub
-          client-payload: '{"version": "${{ jobs.get_latest_release.outputs.tag_name }}"}'

+ 0 - 34
.github/workflows/dispatch_delete_branch_hub.yaml

@@ -1,34 +0,0 @@
-name: Dispatch to hub when deleting pre-release
-
-on:
-  release:
-    types:
-      - deleted
-
-jobs:
-  get_latest_release:
-    name: get_latest_release
-    runs-on: ubuntu-latest
-    permissions:
-      contents: read
-    steps:
-      - id: get_latest_release
-        uses: cardinalby/git-get-release-action@cedef2faf69cb7c55b285bad07688d04430b7ada
-        env:
-          GITHUB_TOKEN: ${{ github.token }}
-        with:
-          latest: true
-          draft: false
-          prerelease: false
-
-  dispatch:
-    name: dispatch to hub-tests
-    runs-on: ubuntu-latest
-    steps:
-      - name: Repository Dispatch
-        uses: peter-evans/repository-dispatch@v1
-        with:
-          token: ${{ secrets.DISPATCH_TOKEN }}
-          event-type: delete_branch
-          repository: crowdsecurity/hub
-          client-payload: '{"version": "${{ jobs.get_latest_release.outputs.tag_name }}"}'

+ 4 - 0
.github/workflows/release_publish-package.yml

@@ -18,6 +18,8 @@ jobs:
         id: go
       - name: Check out code into the Go module directory
         uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
       - name: Build the binaries
         run: make release
       - name: Upload to release
@@ -37,6 +39,8 @@ jobs:
         id: go
       - name: Check out code into the Go module directory
         uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
       - name: Build the binaries
         run: |
           make release BUILD_STATIC=yes

+ 0 - 1
windows/installer/product.wxs

@@ -168,7 +168,6 @@
          <ComponentRef Id="NotifConfig" />
          <ComponentRef Id="CreateCrowdsecPluginsDir"/>
          <ComponentRef Id="CreateCrowdsecDataDir" />
-         <ComponentRef Id="ConsoleDir"/>
          <ComponentRef Id="ConsoleContextFile"/>
          <ComponentRef Id="Csconfig_lapi" />
          <ComponentRef Id="Csconfig_no_lapi" />