Skip to content

Commit

Permalink
[FIX] fix release version before release stage; (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
atlet99 authored Oct 29, 2024
1 parent ed723a1 commit e9ee87e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ jobs:
with:
egress-policy: audit

- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
uses: docker/setup-buildx-action@v1
- name: Log in to DockerHub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -42,13 +37,13 @@ jobs:
id: repo_vars
run: echo "GH_REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Build and Push Docker Image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
uses: docker/build-push-action@v1
with:
context: .
tags: ${{ secrets.DOCKER_USERNAME }}/${{ env.GH_REPO_NAME }}:${{ env.SHORT_SHA }}, ${{ secrets.DOCKER_USERNAME }}/${{ env.GH_REPO_NAME }}:latest
push: true
platforms: 'linux/amd64,linux/arm64'
labels: ${{ github.github_repository }}
labels: ${{ github.repository }}

update-release-version:
name: Update .release-version with tag and build ID
Expand Down Expand Up @@ -92,6 +87,11 @@ jobs:
git commit -m "Update .release-version with version ${{ env.TAG_NAME }} and build ID $short_build_id"
git push origin HEAD:main
- name: Create and push new tag
run: |
git tag ${{ env.TAG_NAME }}
git push origin ${{ env.TAG_NAME }}
release:
name: Create GitHub Release
runs-on: ubuntu-20.04
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 0 # Pull the latest changes including updated .release-version

- name: Read .release-version for Version variable
id: version_file
Expand All @@ -129,11 +129,6 @@ jobs:
printf "Changelogs:\n" > last_commits.txt
git log -4 --pretty=format:"- %s (%h)" >> last_commits.txt
- name: Create and push new tag
run: |
git tag ${{ env.TAG_NAME }}
git push origin ${{ env.TAG_NAME }}
- name: Build Linux binary
run: |
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=${{ env.VERSION }}" -o yed
Expand Down
1 change: 0 additions & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
version v0.1.2 (build 11573150979)

0 comments on commit e9ee87e

Please sign in to comment.