forked from google/osv-scanner
-
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
8c5634d
commit 30eb42c
Showing
2 changed files
with
83 additions
and
76 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
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,80 @@ | ||
name: Release new version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'The version tag to release, (e.g. v1.2.3)' | ||
required: true | ||
type: string | ||
commit: | ||
description: 'The commit hash to release' | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
# Require writing security events to upload SARIF file to security tab | ||
security-events: write | ||
|
||
jobs: | ||
osv-scan: | ||
uses: ./.github/workflows/osv-scanner-reusable.yml | ||
with: | ||
# Only scan the top level go.mod file without recursively scanning directories since | ||
# this is pipeline is about releasing the go module and binary | ||
scan-args: |- | ||
--skip-git | ||
./ | ||
lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
persist-credentials: false | ||
ref: ${{ inputs.commit }} | ||
- name: Set up Go | ||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version-file: .go-version | ||
check-latest: true | ||
- name: Run lint action | ||
uses: ./.github/workflows/lint-action | ||
tests: | ||
name: Run unit tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
persist-credentials: false | ||
ref: ${{ inputs.commit }} | ||
- name: Set up Go | ||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version-file: .go-version | ||
check-latest: true | ||
- name: Run test action | ||
uses: ./.github/workflows/test-action | ||
release-helper: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- lint | ||
- tests | ||
- osv-scan | ||
steps: | ||
- name: Print Scripts | ||
env: | ||
OUTPUT: |- | ||
git fetch upstream | ||
git tag ${{ inputs.version }} ${{ inputs.commit }} | ||
git push upstream ${{ inputs.version }} | ||
run: | | ||
echo $OUTPUT |