2022-12-18 18:42:57 -07:00
|
|
|
name: Release
|
|
|
|
# This workflow is triggered manually
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version_bump_type:
|
|
|
|
description: 'Version Bump Type (major, minor, patch)'
|
|
|
|
required: true
|
|
|
|
default: 'patch'
|
|
|
|
version_metadata_path:
|
|
|
|
description: 'Path to file containing Version string'
|
|
|
|
required: true
|
|
|
|
default: 'backend/pkg/version/version.go'
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Create Release Commit
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: ghcr.io/packagrio/packagr:latest-golang
|
|
|
|
env:
|
|
|
|
STATIC: true
|
|
|
|
steps:
|
2023-03-13 10:15:07 -06:00
|
|
|
# - name: Get Packagr Token
|
|
|
|
# id: packagr-token
|
|
|
|
# uses: getsentry/action-github-app-token@v2
|
|
|
|
# with:
|
|
|
|
# app_id: ${{ secrets.PACKAGR_APP_ID }}
|
|
|
|
# private_key: ${{ secrets.PACKAGR_APP_PRIVATE_KEY }}
|
2022-12-18 18:42:57 -07:00
|
|
|
- name: Git
|
|
|
|
run: |
|
|
|
|
apt-get update && apt-get install -y software-properties-common
|
|
|
|
add-apt-repository ppa:git-core/ppa && apt-get update && apt-get install -y git
|
|
|
|
git --version
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Bump version
|
|
|
|
id: bump_version
|
|
|
|
uses: packagrio/action-bumpr-go@master
|
|
|
|
with:
|
|
|
|
version_bump_type: ${{ github.event.inputs.version_bump_type }}
|
|
|
|
version_metadata_path: ${{ github.event.inputs.version_metadata_path }}
|
|
|
|
env:
|
2023-03-13 10:15:07 -06:00
|
|
|
GITHUB_TOKEN: ${{ secrets.PACKAGR_GITHUB_TOKEN }}
|
|
|
|
# GITHUB_TOKEN: ${{ steps.packagr-token.outputs.token }}
|
2023-01-31 19:56:16 -07:00
|
|
|
# - name: Test
|
|
|
|
# run: |
|
|
|
|
# make test
|
2022-12-18 18:42:57 -07:00
|
|
|
- name: Commit Changes Locally
|
|
|
|
id: commit
|
|
|
|
uses: packagrio/action-releasr-go@master
|
|
|
|
env:
|
2023-03-13 10:15:07 -06:00
|
|
|
GITHUB_TOKEN: ${{ secrets.PACKAGR_GITHUB_TOKEN }}
|
|
|
|
# GITHUB_TOKEN: ${{ steps.packagr-token.outputs.token }}
|
2022-12-18 18:42:57 -07:00
|
|
|
with:
|
|
|
|
version_metadata_path: ${{ github.event.inputs.version_metadata_path }}
|
|
|
|
- name: Publish Release & Assets
|
|
|
|
id: publish
|
|
|
|
uses: packagrio/action-publishr-go@master
|
|
|
|
env:
|
|
|
|
# This is necessary in order to push a commit to the repo
|
2023-03-13 10:15:07 -06:00
|
|
|
GITHUB_TOKEN: ${{ secrets.PACKAGR_GITHUB_TOKEN }}
|
|
|
|
# GITHUB_TOKEN: ${{ steps.packagr-token.outputs.token }}
|
2022-12-18 18:42:57 -07:00
|
|
|
with:
|
|
|
|
version_metadata_path: ${{ github.event.inputs.version_metadata_path }}
|
|
|
|
|