Skip to content

Commit

Permalink
added build and package steps, and fossa job
Browse files Browse the repository at this point in the history
  • Loading branch information
enrichman committed Apr 19, 2024
1 parent e3048ec commit 7c3522f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
2 changes: 1 addition & 1 deletion scripts/version
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c3522f

Please sign in to comment.