Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Release PASS-auth

Release PASS-auth #6

Workflow file for this run

name: Release PASS-auth
on:
workflow_dispatch:
inputs:
releaseversion:
required: true
description: Version to release (e.g. 0.3.0)
nextversion:
required: true
description: Next development version (e.g. 0.4.0-SNAPSHOT)
jobs:
release:
if: github.repository == 'eclipse-pass/pass-auth'
runs-on: ubuntu-latest
env:
DOCKER_IMAGE_NAME: ghcr.io/eclipse-pass/pass-auth
steps:
- uses: actions/checkout@v3
- name: Config git user
run: |
git config user.name ${{ github.actor }}
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Setup Node & Yarn
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Update project version to release version
run: |
yarn install --frozen-lockfile
yarn version --new-version ${{ inputs.releaseversion }}
- name: Tag release
run: git tag ${{ inputs.releaseversion }}
- name: Build pass-auth
run: |
yarn install --frozen-lockfile
yarn run build
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push release version image
run: docker push $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }}
- name: Bump project version to next dev version
run: yarn version --new-version ${{ inputs.nextversion }}
# Commits made to branch specified in workflow_dispatch, push that branch if possible
- name: Push release commits to GH
if: github.ref_type == 'branch' && github.ref_protected == false
run: git push origin ${{ github.ref_name }}
# Push the release tag we made above
- name: Push release tag to GH
run: git push origin ${{ inputs.releaseversion }}
- name: Retag and push next dev image
run: |
docker tag $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }} $DOCKER_IMAGE_NAME:${{ inputs.nextversion }}
docker push $DOCKER_IMAGE_NAME:${{ inputs.nextversion }}
- name: 'Retag and push :latest image'
run: |
docker tag $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }} $DOCKER_IMAGE_NAME:latest
docker push $DOCKER_IMAGE_NAME:latest