forked from aquasecurity/trivy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fced4f
commit e3870a4
Showing
2 changed files
with
60 additions
and
36 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Release test | ||
on: workflow_dispatch | ||
|
||
env: | ||
GO_VERSION: '1.22' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
cache: false # Disable cache to avoid free space issues during `Post Setup Go` step. | ||
|
||
|
||
# Create tmp dir for GoReleaser | ||
- name: "create tmp dir" | ||
run: | | ||
mkdir tmp | ||
- name: GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
version: v2.1.0 | ||
args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }} | ||
TMPDIR: "tmp" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,54 +4,39 @@ on: | |
tags: | ||
- "v*" | ||
|
||
env: | ||
GO_VERSION: '1.22' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
uses: ./.github/workflows/reusable-release.yaml | ||
with: | ||
goreleaser_config: goreleaser.yml | ||
goreleaser_options: '--clean --timeout 90m' | ||
secrets: inherit | ||
|
||
deploy-packages: | ||
name: Deploy rpm/dep packages | ||
needs: release # run this job after 'release' job completes | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Restore Trivy binaries from cache | ||
uses: actions/[email protected] | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
path: dist/ | ||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}} | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get -y update | ||
sudo apt-get -y install rpm reprepro createrepo-c distro-info | ||
go-version: ${{ env.GO_VERSION }} | ||
cache: false # Disable cache to avoid free space issues during `Post Setup Go` step. | ||
|
||
- name: Checkout trivy-repo | ||
uses: actions/[email protected] | ||
with: | ||
repository: ${{ github.repository_owner }}/trivy-repo | ||
path: trivy-repo | ||
fetch-depth: 0 | ||
token: ${{ secrets.ORG_REPO_TOKEN }} | ||
|
||
- name: Setup git settings | ||
# Create tmp dir for GoReleaser | ||
- name: "create tmp dir" | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Teppei Fukuda" | ||
mkdir tmp | ||
- name: Create rpm repository | ||
run: ci/deploy-rpm.sh | ||
|
||
- name: Import GPG key | ||
run: echo -e "${{ secrets.GPG_KEY }}" | gpg --import | ||
- name: GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
version: v2.1.0 | ||
args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }} | ||
TMPDIR: "tmp" | ||
|
||
- name: Create deb repository | ||
run: ci/deploy-deb.sh |