Skip to content

Commit

Permalink
[v2.9] Migrate from Drone to Github Actions, remove Dapper and add Da…
Browse files Browse the repository at this point in the history
…rwin/arm64 support (#362)

* enabled gofmt linter, added lint scripts, removed dapper from Makefile

* added build (with arm64 support), package steps, and fossa job

* github tag, and envs

* upload assets

* removed dapper and google cloud storage

* moved checkout steps

* removed drone.yml

* requested changes

- removed extra Test step
- added check for run on PRs
- added FOSSA check on release

* moved fossa in its own workflow

* remove manual trigger and tag check on release
  • Loading branch information
enrichman committed May 6, 2024
1 parent a85cc10 commit 192a95e
Show file tree
Hide file tree
Showing 19 changed files with 166 additions and 400 deletions.
299 changes: 0 additions & 299 deletions .drone.yml

This file was deleted.

56 changes: 32 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,50 @@ jobs:

build:
runs-on: ubuntu-latest

steps:
- 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: Test
run: go test -v ./...
- name: Validate Go modules
run: ./scripts/validate

- name: Build
run: make build
- name: Test
run: ./scripts/test

fossa:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # needed for the Vault authentication
- name: Get Tag
if: startsWith(github.ref, 'refs/tags/v')
run: echo "GITHUB_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV

steps:
- 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: Checkout Repo
uses: actions/checkout@v3

- name: Check FOSSA compliance
uses: fossas/fossa-action@main
with:
api-key: ${{ env.FOSSA }}
- name: 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 }}
Loading

0 comments on commit 192a95e

Please sign in to comment.