diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79917daa..b9bb9245 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 56076134..35c93a50 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 a05b035f..837070f6 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