release #7
This file contains 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 | |
permissions: | |
packages: write | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: version | |
required: true | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
code-lint: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 # action page: <https://github.com/actions/setup-go> | |
with: | |
go-version: stable | |
- name: Generate next version | |
id: version | |
uses: ci-space/edit-config@master | |
with: | |
file: action.yaml | |
action: up-image-version | |
pointer: runs.image | |
value: ${{ github.event.inputs.version }} | |
- name: Generate builder values | |
id: values | |
run: | | |
echo "timestamp=$(echo $(date "+%F %T"))" >> $GITHUB_OUTPUT | |
- name: Build image | |
uses: docker/build-push-action@v4 # Action page: <https://github.com/docker/build-push-action> | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
platforms: linux/amd64 | |
build-args: | | |
APP_VERSION=${{ steps.version.outputs.new-version }} | |
BUILD_TIME=${{ steps.values.outputs.timestamp }} | |
tags: | | |
ghcr.io/ci-space/edit-config:${{ steps.version.outputs.new-version }} | |
- name: Commit changes | |
run: | | |
git add action.yaml | |
git commit -m "chore: update image version ${{ steps.version.outputs.new-version }} in action.yaml" | |
git push | |
- name: Create Tag | |
uses: negz/create-tag@v1 | |
with: | |
version: ${{ steps.version.outputs.new-version }} | |
message: '' | |
token: ${{ secrets.GITHUB_TOKEN }} |