@@ -57,21 +57,40 @@ jobs:
57
57
registry : ${{ env.CONTAINER_REGISTRY }}
58
58
username : ${{ github.actor }}
59
59
password : ${{ secrets.GITHUB_TOKEN }}
60
- - run : make install
61
- - run : make build docker BUILD_VERSION="v0.0.0 (master)" CONTAINER_TAG=latest
62
- if : startswith(github.ref, 'refs/heads/master')
63
- - run : make build docker BUILD_VERSION="v0.0.0 ($(echo $GITHUB_REF | sed -e 's/^refs\/pull\///'))" CONTAINER_TAG=dev
64
- if : startswith(github.ref, 'refs/pull/')
65
- - run : make build docker BUILD_VERSION="v$(echo $GITHUB_REF | sed -e 's/^refs\/tags\///')" CONTAINER_TAG="$(echo $GITHUB_REF | sed -e 's/^refs\/tags\///')"
66
- if : startswith(github.ref, 'refs/tags/')
67
- - run : make archive
60
+
61
+ - name : Install deps
62
+ run : make install
63
+
64
+ - name : Set env vars (push)
65
+ run : |
66
+ echo "BUILD_VERSION=0.0.0-beta+commit.${{ github.sha }}" >> $GITHUB_ENV
67
+ echo "CONTAINER_TAG=beta" >> $GITHUB_ENV
68
+ if : github.event_name == 'push'
69
+ - name : Set env vars (pr)
70
+ run : |
71
+ echo "BUILD_VERSION=0.0.0-pr${{ github.event.pull_request.number }}+commit.${{ github.sha }}" >> $GITHUB_ENV
72
+ echo "CONTAINER_TAG=pr${{ github.event.pull_request.number }}" >> $GITHUB_ENV
73
+ if : github.event_name == 'pull_request'
74
+ - name : Set env vars (release)
75
+ run : |
76
+ echo "BUILD_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
77
+ echo "CONTAINER_TAG=latest" >> $GITHUB_ENV
78
+ if : github.event_name == 'release'
79
+
80
+ - name : Build
81
+ run : make build docker archive
82
+
83
+ - name : Publish container image (release)
84
+ run : make docker CONTAINER_TAG=${{ github.event.release.tag_name }}
85
+ if : github.event_name == 'release'
86
+
68
87
- uses : actions/upload-artifact@v4
69
88
with :
70
89
name : artifacts
71
90
path : |
72
91
build/gomp-*
73
92
- uses : softprops/action-gh-release@v2
74
- if : startsWith( github.ref, 'refs/tags/')
93
+ if : github.event_name == 'release'
75
94
with :
76
95
files : |
77
96
build/gomp-*
0 commit comments