Skip to content

Create a workflow for manual releases #37

Create a workflow for manual releases

Create a workflow for manual releases #37

name: Create new version (package.json & CHANGELOG)
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'minor'
type: choice
options:
- patch
- minor
- major
# Required to create OIDC/JWT token required to use shared actions
permissions:
contents: read
pull-requests: write
id-token: write
jobs:
create-new-version:
name: Tag new version (with changelog)
# Required to push the tag
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag.outputs.version }}
steps:
- uses: tibdex/github-app-token@v1
id: get_installation_token
with:
app_id: ${{ secrets.DB_FE_GITHUB_APP_ID }}
installation_id: ${{ secrets.DB_FE_GITHUB_APP_INSTALLATION_ID }}
private_key: ${{ secrets.DB_FE_GITHUB_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: 0
fetch-tags: true
token: ${{ steps.get_installation_token.outputs.token }}
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Create version & update CHANGELOG
id: tag
env:
DB_FE_CI_BOT_EMAIL: ${{ secrets.DB_FE_CI_BOT_EMAIL }}
run: |
git config --global user.email "$DB_FE_CI_BOT_EMAIL"
git config --global user.name "Databases Frontend CI Bot"
git config --global url.https://${{ steps.get_installation_token.outputs.token }}@github.com/.insteadOf https://github.com/
VERSION=$(npm version ${{ inputs.version })
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Push
run: git push origin main --tags
build:
needs: [create-new-version]
uses: grafana/explore-profiles/.github/workflows/build.yml@ifrost/manual-release-workflow
with:
version: ${{ needs.create-new-version.outputs.version }}
ref: ${{ needs.create-new-version.outputs.version }}
package:
needs: [create-new-version, build]
uses: grafana/explore-profiles/.github/workflows/package.yml@ifrost/manual-release-workflow
secrets: inherit
with:
version: ${{ needs.create-new-version.outputs.version }}
github_environment: gcs-no-approval
create-github-release:
needs: [create-new-version, package]
runs-on: ubuntu-latest
steps:
- uses: tibdex/github-app-token@v1
id: get_installation_token
with:
app_id: ${{ secrets.DB_FE_GITHUB_APP_ID }}
installation_id: ${{ secrets.DB_FE_GITHUB_APP_INSTALLATION_ID }}
private_key: ${{ secrets.DB_FE_GITHUB_APP_PRIVATE_KEY }}
- name: Get artifact
uses: actions/download-artifact@v4
with:
name: build-package
path: package
- name: Get changelog
run: awk '/^## / {s++} s == 1 {print}' CHANGELOG.md > release_notes.md
- name: Create Github release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
with:
prerelease: false
generate_release_notes: false
files: package/*
tag_name: ${{ needs.create-new-version.outputs.version }}
token: ${{ steps.get_installation_token.outputs.token }}
body_path: release_notes.md
deploy-to-prod-catalog:
needs: [create-new-version, package]
uses: ./explore-profiles/.github/workflows/deploy-to-catalog.yml

Check failure on line 113 in .github/workflows/create-new-version.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-new-version.yml

Invalid workflow file

invalid value workflow reference: no version specified
with:
version: ${{ needs.create-new-version.outputs.version }}
environment: prod
deploy-to-cloud:
needs: [create-new-version, package]
uses: ./explore-profiles/.github/workflows/deploy.yml
secrets: inherit
strategy:
matrix:
environment: [dev, ops, prod]
with:
version: ${{ needs.create-new-version.outputs.version }}
environment: ${{ matrix.environment }}