-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (85 loc) · 3.57 KB
/
Copy pathrelease.yaml
File metadata and controls
97 lines (85 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
outputs:
# Whether a new release was published (true or false)
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
# Version of the new release. (e.g. 1.3.0)
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
# Major version of the new release. (e.g. 1)
new_release_major_version: ${{ steps.semantic.outputs.new_release_major_version }}
# Minor version of the new release. (e.g. 3)
new_release_minor_version: ${{ steps.semantic.outputs.new_release_minor_version }}
# Patch version of the new release. (e.g. 0)
new_release_patch_version: ${{ steps.semantic.outputs.new_release_patch_version }}
# The distribution channel on which the last release was initially made available (undefined for the default distribution channel).
new_release_channel: ${{ steps.semantic.outputs.new_release_channel }}
# The release notes for the new release.
new_release_notes: ${{ steps.semantic.outputs.new_release_notes }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
- run: gradle build test
- uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
semantic_version: 24
extra_plugins: |
@google/semantic-release-replace-plugin
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push updates to branch for major version
if: steps.semantic.outputs.new_release_published == 'true'
run: |
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}.${{steps.semantic.outputs.new_release_minor_version}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
runs-on: ubuntu-latest
needs:
- release
if: ${{ needs.release.outputs.new_release_published == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/codingpot/github-org-member-manage-action
tags: |
type=raw,value=${{ needs.release.outputs.new_release_major_version }}
type=raw,value=${{ needs.release.outputs.new_release_major_version }}.${{ needs.release.outputs.new_release_minor_version }}
type=raw,value=${{ needs.release.outputs.new_release_version }}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.build
platforms: linux/amd64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}