docs: update documentation for github-org-member-manage-action #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |