Skip to content

Ockam GitHub Release Tag #4

Ockam GitHub Release Tag

Ockam GitHub Release Tag #4

# This workflow releases Ockam asset/release as production
# and also update git tag commit to that updated by mergify.
name: Ockam GitHub Release Tag
on:
workflow_dispatch:
inputs:
git_tag:
description: Git Tag To Update To Ockam Develop Commit
required: false
permissions:
# Contents permission allows us read this repository.
contents: read
# runs every command in bash (for every job in the workflow)
defaults:
run:
shell: bash
jobs:
release_ockam:
runs-on: ubuntu-20.04
environment: release
name: "Release Ockam Assets"
permissions:
# Contents permission allows us write to this repository.
contents: write
steps:
- name: Get Commit Of Develop
id: develop_sha
run: |
develop_sha=$(git ls-remote https://github.com/${{ github.repository_owner }}/ockam.git refs/heads/develop | head -1 | cut -f 1)
echo "sha=$develop_sha" >> $GITHUB_OUTPUT
- name: Checkout To Ockam Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Import GPG key
uses: build-trust/.github/actions/import_gpg@a6377d3c2dac878b92a0da26cdf3da2856c64840
with:
gpg_private_key: '${{ secrets.GPG_PRIVATE_KEY }}'
gpg_password: '${{ secrets.GPG_PASSPHRASE }}'
gpg_name: '${{ secrets.GPG_USER_NAME }}'
gpg_email: '${{ secrets.GPG_EMAIL }}'
- name: Update Tag Commit To That Merged by Mergify On Develop
run: |
git tag -s -a ${{ github.event.inputs.git_tag }} ${{ steps.develop_sha.outputs.sha }} -m "Ockam Release" -f
git push origin ${{ github.event.inputs.git_tag }} -f
- name: Release GitHub Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release edit "${{ github.event.inputs.git_tag }}" --draft=false -R ${{ github.repository_owner }}/ockam