Skip to content

Commit b052797

Browse files
committed
update Release GHA workflow
1 parent bb2529a commit b052797

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

.github/actions/build-docker/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ runs:
107107
cache-to: type=gha,mode=max,scope=${{ inputs.cache-scope }}
108108
provenance: false
109109
sbom: false
110-
load: true
111110

112111
- name: Output image details
113112
shell: bash

.github/workflows/build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ concurrency:
2020
jobs:
2121

2222
test-postgresql-windows:
23-
if: false # false to skip job during debug
23+
if: true # false to skip job during debug
2424
name: Test on Windows
2525
runs-on: windows-latest
2626
steps:
@@ -55,7 +55,7 @@ jobs:
5555

5656

5757
test-postgresql-macos:
58-
if: false # false to skip job during debug
58+
if: true # false to skip job during debug
5959
name: Test on MacOS
6060
runs-on: macos-latest
6161
steps:
@@ -103,7 +103,7 @@ jobs:
103103
run: go test -v -p 1 -parallel 1 -failfast ./...
104104

105105
test-postgresql-ubuntu:
106-
if: false # false to skip job during debug
106+
if: true # false to skip job during debug
107107
name: Test and Build on Ubuntu
108108
runs-on: ubuntu-latest
109109
steps:
@@ -155,7 +155,7 @@ jobs:
155155
args: release --snapshot --skip=publish --clean
156156

157157
build-docs:
158-
if: false # false to skip job during debug
158+
if: true # false to skip job during debug
159159
needs: [test-postgresql-ubuntu, test-postgresql-windows, test-postgresql-macos]
160160
name: Build Docs
161161
runs-on: ubuntu-latest
@@ -201,7 +201,7 @@ jobs:
201201

202202
test-docker-images:
203203
if: true # false to skip job during debug
204-
# needs: [test-postgresql-ubuntu, test-postgresql-windows, test-postgresql-macos]
204+
needs: [test-postgresql-ubuntu, test-postgresql-windows, test-postgresql-macos]
205205
name: Test Docker Image Build
206206
runs-on: ubuntu-latest
207207
steps:
@@ -228,7 +228,3 @@ jobs:
228228
COMMIT=${{ steps.meta.outputs.GIT_HASH }}
229229
DATE=${{ steps.meta.outputs.GIT_TIME }}
230230
VERSION=${{ steps.meta.outputs.VERSION }}
231-
232-
- name: Check image output
233-
run: |
234-
docker run --rm cybertecpostgresql/pg_timetable:pr-717 --version

.github/workflows/release.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
name: Release
2+
3+
permissions:
4+
contents: write
5+
packages: write
6+
pages: write
7+
deployments: write
8+
pull-requests: write
9+
issues: write
10+
211
on:
312
release:
413
types: [created]
@@ -38,20 +47,25 @@ jobs:
3847
- name: Check out code into the Go module directory
3948
uses: actions/checkout@v5
4049

41-
- name: Version strings
42-
id: version
50+
- name: Prepare build metadata
51+
id: meta
4352
run: |
44-
echo "RELEASE_TIME=$(git show -s --format=%cI HEAD)" >> $GITHUB_OUTPUT
53+
echo "GIT_HASH=${{ github.sha }}" >> $GITHUB_OUTPUT
54+
echo "GIT_TIME=$(git show -s --format=%cI HEAD)" >> $GITHUB_OUTPUT
55+
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT
4556
46-
- name: Publish to Registry
47-
uses: elgohr/Publish-Docker-Github-Action@v5
48-
env:
49-
VERSION: ${{ github.ref_name }}
50-
COMMIT: ${{ github.sha }}
51-
DATE: ${{ steps.version.outputs.RELEASE_TIME }}
57+
- name: Build and push Docker image
58+
uses: ./.github/actions/build-docker
5259
with:
53-
name: cybertecpostgresql/pg_timetable
60+
dockerfile: Dockerfile
61+
image-name: cybertecpostgresql/pg_timetable
62+
registry: docker.io
5463
username: ${{ secrets.DOCKER_USERNAME }}
5564
password: ${{ secrets.DOCKER_PASSWORD }}
56-
buildargs: VERSION,COMMIT,DATE
57-
tag_semver: true
65+
platforms: linux/amd64,linux/arm64
66+
push: 'true'
67+
cache-scope: shared-release
68+
build-args: |
69+
COMMIT=${{ steps.meta.outputs.GIT_HASH }}
70+
DATE=${{ steps.meta.outputs.GIT_TIME }}
71+
VERSION=${{ steps.meta.outputs.VERSION }}

0 commit comments

Comments
 (0)