File tree Expand file tree Collapse file tree 4 files changed +73
-6
lines changed
actions/automatic-releases Expand file tree Collapse file tree 4 files changed +73
-6
lines changed Original file line number Diff line number Diff line change
1
+ # Definition of the github action
2
+ # as per https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action
3
+
4
+ name : ' laminas/automatic-releases'
5
+ description : ' Automates automatic releases for semver-compliant repositories'
6
+
7
+ inputs :
8
+ command-name :
9
+ description : |
10
+ Command to execute: one of
11
+ * `laminas:automatic-releases:release`
12
+ * `laminas:automatic-releases:create-merge-up-pull-request`
13
+ * `laminas:automatic-releases:switch-default-branch-to-next-minor`
14
+ required : true
15
+
16
+ runs :
17
+ using : ' docker'
18
+ image : ' ../../../Dockerfile'
19
+ args :
20
+ - ${{ inputs.command-name }}
Original file line number Diff line number Diff line change 17
17
uses : " actions/checkout@v2"
18
18
19
19
- name : " Release"
20
- uses : " ./"
20
+ uses : " ./.github/actions/automatic-releases/ "
21
21
with :
22
22
command-name : " laminas:automatic-releases:release"
23
23
env :
27
27
" GIT_AUTHOR_EMAIL " : ${{ secrets.GIT_AUTHOR_EMAIL }}
28
28
29
29
- name : " Create Merge-Up Pull Request"
30
- uses : " ./"
30
+ uses : " ./.github/actions/automatic-releases/ "
31
31
with :
32
32
command-name : " laminas:automatic-releases:create-merge-up-pull-request"
33
33
env :
37
37
" GIT_AUTHOR_EMAIL " : ${{ secrets.GIT_AUTHOR_EMAIL }}
38
38
39
39
- name : " Create and/or Switch to new Release Branch"
40
- uses : " ./"
40
+ uses : " ./.github/actions/automatic-releases/ "
41
41
with :
42
42
command-name : " laminas:automatic-releases:switch-default-branch-to-next-minor"
43
43
env :
47
47
" GIT_AUTHOR_EMAIL " : ${{ secrets.GIT_AUTHOR_EMAIL }}
48
48
49
49
- name : " Bump Changelog Version On Originating Release Branch"
50
- uses : " ./"
50
+ uses : " ./.github/actions/automatic-releases/ "
51
51
with :
52
52
command-name : " laminas:automatic-releases:bump-changelog"
53
53
env :
57
57
" GIT_AUTHOR_EMAIL " : ${{ secrets.GIT_AUTHOR_EMAIL }}
58
58
59
59
- name : " Create new milestones"
60
- uses : " ./"
60
+ uses : " ./.github/actions/automatic-releases/ "
61
61
with :
62
62
command-name : " laminas:automatic-releases:create-milestones"
63
63
env :
Original file line number Diff line number Diff line change
1
+ name : Build and push containers
2
+
3
+ on :
4
+ release :
5
+ types : [published]
6
+
7
+ jobs :
8
+ tags :
9
+ runs-on : ubuntu-latest
10
+ outputs :
11
+ tags : ${{ steps.tags.outputs.tags }}
12
+ steps :
13
+ - name : Compile tag list
14
+ id : tags
15
+ run : |
16
+ TAG=${GITHUB_REF/refs\/tags\//}
17
+ PREFIX=ghcr.io/laminas/automatic-releases
18
+ MAJOR="${PREFIX}:$(echo ${TAG} | cut -d. -f1)"
19
+ MINOR="${MAJOR}.$(echo ${TAG} | cut -d. -f2)"
20
+ PATCH="${PREFIX}:${TAG}"
21
+ echo "::set-output name=tags::${MAJOR}%0A${MINOR}%0A${PATCH}"
22
+
23
+ release-container :
24
+ runs-on : ubuntu-latest
25
+ needs : [tags]
26
+ steps :
27
+ - name : Checkout
28
+ uses : actions/checkout@v2
29
+ - name : Setup QEMU
30
+ uses : docker/setup-qemu-action@v1
31
+ - name : Setup Docker Buildx
32
+ uses : docker/setup-buildx-action@v1
33
+ - name : Login to GitHub Container Registry
34
+ uses : docker/login-action@v1
35
+ with :
36
+ registry : ghcr.io
37
+ username : ${{ secrets.CONTAINER_USERNAME }}
38
+ password : ${{ secrets.CONTAINER_PAT }}
39
+ - name : Build and push
40
+ uses : docker/build-push-action@v2
41
+ with :
42
+ context : .
43
+ file : ./Dockerfile
44
+ platforms : linux/amd64
45
+ push : true
46
+ tags : ${{ needs.tags.outputs.tags }}
47
+
Original file line number Diff line number Diff line change @@ -15,6 +15,6 @@ inputs:
15
15
16
16
runs :
17
17
using : ' docker'
18
- image : ' Dockerfile '
18
+ image : ' docker://ghcr.io/laminas/automatic-releases:1 '
19
19
args :
20
20
- ${{ inputs.command-name }}
You can’t perform that action at this time.
0 commit comments