Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problems with WF #23

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,7 @@ jobs:
- name: Determine target release
id: get_target_release
run: |
# create_release=true

# if ${{ github.event_name == 'schedule' }}; then
# commits_count=$(git rev-list --count --no-merges ${{ steps.get_current_release.outputs.tag }}..HEAD --before=1.hour)
# if [ $commits_count -eq 0 ]; then
# create_release=false
# echo "There are no commits since latest release, nothing to do."
# fi
# version_bump=patch
# else
version_bump=${{ inputs.version-bump }}
# fi

echo "Create release: $create_release"
echo "create_release=$create_release" >> $GITHUB_OUTPUT

# if [ "$create_release" != true ]; then
# exit 0
# fi

version_bump=${{ inputs.version-bump }}
desired_version=${{ inputs.desired-version }}
current_version=${{ steps.get_current_release.outputs.version }}

Expand Down Expand Up @@ -128,14 +109,12 @@ jobs:

- name: Determine target commit
id: get_target_commit
# if: steps.get_target_release.outputs.create_release == 'true'
run: |
sha=$(git rev-parse HEAD)
echo "Target commit: $sha"
echo "sha=$sha" >> $GITHUB_OUTPUT

- name: Wait for check suites to complete
# if: steps.get_target_release.outputs.create_release == 'true'
uses: sap-contributions/await-check-suites@master
with:
ref: ${{ steps.get_target_commit.outputs.sha }}
Expand All @@ -145,7 +124,6 @@ jobs:
appSlugFilter: github-actions

- name: Create Release
# if: steps.get_target_release.outputs.create_release == 'true'
env:
GH_TOKEN: ${{ secrets.WORKFLOW_USER_GH_TOKEN }}
run: |
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
FROM golang:1.21.0-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.21.0-alpine AS builder
ARG TARGETOS
ARG TARGETARCH

WORKDIR /src/
COPY go.mod go.mod
COPY go.sum go.sum
COPY main.go main.go
RUN go mod download
RUN apk -U add binutils && CGO_ENABLED=0 go build -o prometheus-logstash-exporter && strip prometheus-logstash-exporter
RUN apk -U add binutils \
&& CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -o prometheus-logstash-exporter \
&& strip prometheus-logstash-exporter

FROM scratch
WORKDIR /
Expand Down