forked from rancher/cli
-
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
Showing
20 changed files
with
196 additions
and
377 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,27 +1,58 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
go-version-file: go.mod | ||
cache: false | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v4 | ||
|
||
- name: Validate Go modules | ||
run: ./scripts/validate | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
run: ./scripts/test | ||
|
||
- name: Get Tag | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: echo "GITHUB_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV | ||
|
||
- name: Build | ||
run: make build | ||
env: | ||
CROSS: 1 | ||
run: ./scripts/build | ||
|
||
- name: Package | ||
run: | | ||
./scripts/package | ||
ls -lR dist/artifacts | ||
# Stage binary for packaging step | ||
cp -r ./bin/* ./package/ | ||
# Export the tag for the next step | ||
source ./scripts/version | ||
echo "VERSION=$VERSION" | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Docker Build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: false | ||
context: package | ||
tags: rancher/cli2:${{ env.VERSION }} |
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,31 @@ | ||
name: FOSSA | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- v* | ||
|
||
jobs: | ||
fossa: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
id-token: write # needed for the Vault authentication | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load Secrets from Vault | ||
uses: rancher-eio/read-vault-secrets@main | ||
with: | ||
secrets: | | ||
secret/data/github/repo/${{ github.repository }}/fossa/credentials token | FOSSA | ||
- name: Check FOSSA compliance | ||
uses: fossas/fossa-action@main | ||
with: | ||
api-key: ${{ env.FOSSA }} |
Oops, something went wrong.