Skip to content

Commit

Permalink
fix(ci): fix release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkoops committed May 8, 2024
1 parent 0ba7e5c commit f19597a
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 "${RELEASE_VERSION}" ]]; then
# echo "Updating to @patternfly/patternfly: ${RELEASE_VERSION}"
# npm pkg set dependencies.@patternfly/patternfly=${RELEASE_VERSION} --workspace @patternfly/react-docs
# npm pkg set devDependencies.@patternfly/patternfly=${RELEASE_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
release-version:
description: The version of 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 }}
RELEASE_VERSION: ${{ github.event.inputs.release-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 f19597a

Please sign in to comment.