diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 5fd099c..5e9e2df 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -20,6 +20,9 @@ env: jobs: # Build FDO-Support and pushes it to Dockerhub build-push: + # Prevent this action from running in forks + if: github.repository_owner == 'open-horizon' + runs-on: ubuntu-latest # Environment variables available to all steps @@ -86,15 +89,15 @@ jobs: # Checkout our Github repo - name: Checkout Github Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: go/src/github.com/${{ github.repository }} # Prepare the environment - - name: Set up golang 1.21 - uses: actions/setup-go@v2 + - name: Set up golang 1.23 + uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.23' check-latest: true # Configure version variables for later steps, stored in our workflow env. variables diff --git a/.github/workflows/build-verification.yml b/.github/workflows/build-verification.yml new file mode 100644 index 0000000..b1c6cb1 --- /dev/null +++ b/.github/workflows/build-verification.yml @@ -0,0 +1,43 @@ +name: Build Verification + +on: + push: + branches-ignore: + - main + workflow_dispatch: + +jobs: + build-verification: + runs-on: ubuntu-latest + + env: + GOPATH: ${{ github.workspace }}/go + REPO_DIR: ${{ github.workspace }}/go/src/github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} + + steps: + - name: Checkout GitHub Repo + uses: actions/checkout@v4 + with: + path: go/src/github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} + + - name: Set up Go 1.23 + uses: actions/setup-go@v5 + with: + go-version: '1.23' + check-latest: true + + - name: Config Version Variables + id: config-version + run: | + cd "$REPO_DIR" + VERSION=$(sed -n 's/export VERSION ?= //p' Makefile | cut -d '$' -f 1) + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + - name: Compile and Build Docker Images + run: | + cd "$REPO_DIR" + make clean + make + docker image ls + env: + VERSION: '${{ steps.config-version.outputs.VERSION }}-${{ github.run_number }}'