parent
dbc06d430f
commit
b561a370cd
19
.github/workflows/ci-windows-build-msi.yml
vendored
19
.github/workflows/ci-windows-build-msi.yml
vendored
|
@ -11,6 +11,18 @@ on:
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
|
|
||||||
jobs:
|
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
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
|
@ -23,13 +35,8 @@ jobs:
|
||||||
id: go
|
id: go
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- id: get_latest_release
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
repository: crowdsecurity/crowdsec
|
|
||||||
excludes: draft
|
|
||||||
- id: set_release_in_env
|
- id: set_release_in_env
|
||||||
run: echo "BUILD_VERSION=${{ steps.get_latest_release.outputs.release }}" >> $env:GITHUB_ENV
|
run: echo "BUILD_VERSION=${{ jobs.get_latest_release.outputs.tag_name }}" >> $env:GITHUB_ENV
|
||||||
- name: Build
|
- name: Build
|
||||||
run: make windows_installer
|
run: make windows_installer
|
||||||
- name: Upload MSI
|
- name: Upload MSI
|
||||||
|
|
|
@ -2,23 +2,33 @@ name: Dispatch to hub when creating pre-release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: prereleased
|
types:
|
||||||
|
- prereleased
|
||||||
|
|
||||||
jobs:
|
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:
|
dispatch:
|
||||||
name: dispatch to hub-tests
|
name: dispatch to hub-tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- id: keydb
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: crowdsecurity
|
|
||||||
repo: crowdsec
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Repository Dispatch
|
- name: Repository Dispatch
|
||||||
uses: peter-evans/repository-dispatch@v1
|
uses: peter-evans/repository-dispatch@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||||
event-type: create_branch
|
event-type: create_branch
|
||||||
repository: crowdsecurity/hub
|
repository: crowdsecurity/hub
|
||||||
client-payload: '{"version": "${{ steps.keydb.outputs.release }}"}'
|
client-payload: '{"version": "${{ jobs.get_latest_release.outputs.tag_name }}"}'
|
||||||
|
|
|
@ -2,23 +2,33 @@ name: Dispatch to hub when deleting pre-release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: deleted
|
types:
|
||||||
|
- deleted
|
||||||
|
|
||||||
jobs:
|
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:
|
dispatch:
|
||||||
name: dispatch to hub-tests
|
name: dispatch to hub-tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- id: keydb
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: crowdsecurity
|
|
||||||
repo: crowdsec
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Repository Dispatch
|
- name: Repository Dispatch
|
||||||
uses: peter-evans/repository-dispatch@v1
|
uses: peter-evans/repository-dispatch@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||||
event-type: delete_branch
|
event-type: delete_branch
|
||||||
repository: crowdsecurity/hub
|
repository: crowdsecurity/hub
|
||||||
client-payload: '{"version": "${{ steps.keydb.outputs.release }}"}'
|
client-payload: '{"version": "${{ jobs.get_latest_release.outputs.tag_name }}"}'
|
||||||
|
|
67
.github/workflows/release_publish-package.yml
vendored
67
.github/workflows/release_publish-package.yml
vendored
|
@ -3,46 +3,47 @@ name: build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: prereleased
|
types:
|
||||||
|
- prereleased
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build and upload binary package
|
name: Build and upload binary package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.19
|
- name: Set up Go 1.19
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.19
|
||||||
id: go
|
id: go
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Build the binaries
|
- name: Build the binaries
|
||||||
run: make release
|
run: make release
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
uses: JasonEtco/upload-to-release@master
|
uses: JasonEtco/upload-to-release@master
|
||||||
with:
|
with:
|
||||||
args: crowdsec-release.tgz application/x-gzip
|
args: crowdsec-release.tgz application/x-gzip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
build_static:
|
build_static:
|
||||||
name: Build and upload binary package
|
name: Build and upload binary package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.19
|
- name: Set up Go 1.19
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.19
|
||||||
id: go
|
id: go
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Build the binaries
|
- name: Build the binaries
|
||||||
run: |
|
run: |
|
||||||
make release BUILD_STATIC=yes
|
make release BUILD_STATIC=yes
|
||||||
mv crowdsec-release.tgz crowdsec-release-static.tgz
|
mv crowdsec-release.tgz crowdsec-release-static.tgz
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
uses: JasonEtco/upload-to-release@master
|
uses: JasonEtco/upload-to-release@master
|
||||||
with:
|
with:
|
||||||
args: crowdsec-release-static.tgz application/x-gzip
|
args: crowdsec-release-static.tgz application/x-gzip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
Loading…
Reference in a new issue