Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike/Automated releases using shell script #1229

Merged
merged 9 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 38 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,52 @@
name: Release

on:
push:
paths:
- package.json
branches:
- main

jobs:
workflow_dispatch:
inputs:
release_type:
description: Type of release to perform
required: true
default: patch

jobs:
build-and-publish:
name: Build & Publish Release
runs-on: ubuntu-latest
environment: 'prod'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure git user
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
# Checkout branch, bump version, push, merge, create release
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

- name: Bump Package Version
id: bump_version
run: |
npm version ${{ inputs.release_type }}
echo "RELEASE_VERSION=$(cat package.json | jq .version | tr -d '"')" >> $GITHUB_ENV

- name: Bump Version and Create Release
run: |
git checkout -b $RELEASE_VERSION
git push --set-upstream origin $RELEASE_VERSION
gh pr create --base main -f
gh pr merge --squash
env:
GITHUB_TOKEN: ${{ secrets.PREFECT_CONTENTS_PR_RW }}

- uses: actions/checkout@v4
with:
ref: main

- uses: prefecthq/actions-release-ui-components@main
id: release-ui-components
Expand Down
7 changes: 7 additions & 0 deletions prefect-design-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
echo "Is the release a major, minor, or patch release?"
read release_type
gh workflow run release.yaml \
--repo=prefecthq/prefect-design \
--ref=main \
-f release_type=$release_type
Loading