From 7c3522fdc5d2a6878153d4d3c8c191b49a94f2c0 Mon Sep 17 00:00:00 2001 From: Enrico Candino Date: Fri, 19 Apr 2024 14:33:59 +0200 Subject: [PATCH] added build and package steps, and fossa job --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ scripts/package | 4 ++-- scripts/version | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79917daa5..b9bb9245d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,3 +31,25 @@ jobs: env: CROSS: 1 run: ./scripts/build + + - name: Package + run: | + ./scripts/package + ls -lR dist/artifacts + # Stage binary for packaging step + cp -r ./bin/* ./package/ + + - name: Docker Build + uses: docker/build-push-action@v5 + with: + push: false + context: package + tags: rancher/cli2:$GITHUB_REF_NAME + + fossa: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: fossas/fossa-action@main + with: + api-key: ${{ secrets.fossaApiKey }} diff --git a/scripts/package b/scripts/package index 56076134f..35c93a501 100755 --- a/scripts/package +++ b/scripts/package @@ -71,8 +71,8 @@ if echo $TAG | grep -q dirty; then TAG=dev fi -if [ -n "$DRONE_TAG" ]; then - TAG=$DRONE_TAG +if [ -n "$GITHUB_REF_NAME" ]; then + TAG=$GITHUB_REF_NAME fi cp ../bin/rancher . diff --git a/scripts/version b/scripts/version index a05b035fc..837070f61 100755 --- a/scripts/version +++ b/scripts/version @@ -5,7 +5,7 @@ if [ -n "$(git status --porcelain --untracked-files=no)" ]; then fi COMMIT=$(git rev-parse --short HEAD) -GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)} +GIT_TAG=${GITHUB_REF_NAME:-$(git tag -l --contains HEAD | head -n 1)} if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then VERSION=$GIT_TAG