Create release #17
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: Create release | |
on: | |
workflow_dispatch: | |
inputs: | |
bump: | |
description: Increment major, minor, or patch version | |
type: choice | |
required: true | |
default: auto | |
options: | |
- auto | |
- major | |
- minor | |
- patch | |
permissions: | |
contents: write | |
packages: write | |
concurrency: ${{ github.workflow }} | |
jobs: | |
create-release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Make sure that the container image is built | |
run: skopeo inspect 'docker://ghcr.io/ciffelia/koe:git-${{ github.sha }}' | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Setup devtools | |
run: yarn install --immutable | |
working-directory: ./devtools | |
- name: Configure git author | |
run: | | |
git config user.name 'github-actions' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Create release | |
run: | | |
echo 'Creating ${{ inputs.bump }} release' | |
if [ '${{ inputs.bump }}' == 'auto' ]; then | |
yarn run create-release | |
else | |
yarn run create-release '${{ inputs.bump }}' | |
fi | |
working-directory: ./devtools | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate Docker tags | |
id: generate-docker-tags | |
run: | | |
tags="$(yarn run generate-docker-tags)" | |
echo "$tags" | |
echo "tags=$tags" >> $GITHUB_OUTPUT | |
working-directory: ./devtools | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Docker tags | |
run: | | |
for tag in ${{ steps.generate-docker-tags.outputs.tags }} | |
do | |
skopeo copy --all 'docker://ghcr.io/ciffelia/koe:git-${{ github.sha }}' "docker://ghcr.io/ciffelia/koe:$tag" | |
done |