Skip to content

Commit

Permalink
Add nightly release and remove pre release workflow (Checkmarx#1843)
Browse files Browse the repository at this point in the history
* add nightly release and remove pre release

* add commit sha to nightly release name

* remove unused file
  • Loading branch information
elit-cx authored Jan 25, 2021
1 parent a4c4b6f commit 36053b7
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 59 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: goreleaser scheduled

on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --config="./.goreleaser-nightly.yml"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: delete release
uses: dev-drprasad/[email protected]
with:
delete_release: true # default: false
tag_name: nightly # tag name to delete
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
release_name: nightly-${{ github.sha }}
draft: false
prerelease: true
- name: dislay assets
run: |
ls -l /home/runner/work/kics/kics/dist
- name: Upload Release Asset linux
id: upload-release-asset-linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/kics/kics/dist/kics_nightly_linux_x64.tar.gz
asset_name: test_nightly-release_linux_amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset windows
id: upload-release-asset-windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/kics/kics/dist/kics_nightly_windows_x64.zip
asset_name: test_nightly-release_windows_amd64.zip
asset_content_type: application/zip
- name: Upload Release Asset checksum
id: upload-release-asset-checksums
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/kics/kics/dist/kics_nightly_checksums.txt
asset_name: test_nightly-release_checksums.txt
asset_content_type: text/plain
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: checkmarx/kics
tag_with_ref: false
tags: nightly
59 changes: 0 additions & 59 deletions .github/workflows/prerelease.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .goreleaser-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
project_name: kics

builds:
- main: ./cmd/console/main.go
binary: kics
goos:
- linux
- windows
goarch:
- amd64
archives:
-
builds: [kics]
format_overrides:
- goos: windows
format: zip
replacements:
amd64: x64
386: x32
files:
- assets/queries
release:
prerelease: true
snapshot:
name_template: "nightly"

0 comments on commit 36053b7

Please sign in to comment.