Skip to content

Commit

Permalink
chore(ci): clean up release and promote workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Koops <jonkoops@gmail.com>
  • Loading branch information
jonkoops committed May 10, 2024
1 parent 3c33eb9 commit b64f6ae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/promote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
# Update their versions and changelogs according to angular commit guidelines
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit

# if [[ ! -z "${CORE_VERSION}" ]]; then
# echo "Updating to @patternfly/patternfly: ${CORE_VERSION}"
# npm pkg set dependencies.@patternfly/patternfly=${CORE_VERSION} --workspace @patternfly/react-docs
# npm pkg set devDependencies.@patternfly/patternfly=${CORE_VERSION} --workspace @patternfly/react-core --workspace @patternfly/react-styles --workspace @patternfly/react-tokens --workspace @patternfly/react-icons
# if [[ ! -z "${PATTERNFLY_VERSION}" ]]; then
# echo "Updating to @patternfly/patternfly: ${PATTERNFLY_VERSION}"
# npm pkg set dependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @patternfly/react-docs
# npm pkg set devDependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @patternfly/react-core --workspace @patternfly/react-styles --workspace @patternfly/react-tokens --workspace @patternfly/react-icons
# fi

# publish to npm
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
name: promote
name: Promote
on:
workflow_dispatch:
inputs:
core-version:
description: The PatternFly core version
patternfly-version:
description: The version of PatternFly (`@patternfly/patternfly`) to promote to.
required: false
jobs:
deploy:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CORE_VERSION: ${{ github.event.inputs.core-version }}
RELEASE_VERSION: ${{ github.event.inputs.version }}
GH_TOKEN: ${{ secrets.GH_TOKEN_REDALLEN }}
steps:
- name: Check out project
uses: actions/checkout@v4
with:
# Needs to be an admin token to get around branch protection.
# Pass in an administrator token to get around branch protection.
token: ${{ secrets.GH_TOKEN_REDALLEN }}

- name: Set up and build project
Expand All @@ -27,3 +22,6 @@ jobs:

- name: Deploy to NPM and Github
run: .github/promote.sh
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PATTERNFLY_VERSION: ${{ github.event.inputs.patternfly-version }}
15 changes: 5 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,22 @@ jobs:
name: Deploy release
runs-on: ubuntu-latest
needs: [ci, docs]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Needs to be an admin token to get around branch protection.
GH_TOKEN: ${{ secrets.GH_TOKEN_REDALLEN }}
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
steps:
- name: Check out project
uses: actions/checkout@v4
with:
# Fetch all history for all branches and tags, which is needed for the release script.
fetch-depth: 0
# Needs to be an admin token to get around branch protection.
# Pass in an administrator token to get around branch protection.
token: ${{ secrets.GH_TOKEN_REDALLEN }}

# Fetches all tags from 'origin' and updates local tags, only fetches the latest commit.
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up and build project
uses: ./.github/actions/setup-project
with:
skip-build-cache: true

- name: Deploy to NPM and Github
run: .github/release.sh
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}

0 comments on commit b64f6ae

Please sign in to comment.