Skip to content

Commit f19597a

Browse files
committed
fix(ci): fix release pipeline
1 parent 0ba7e5c commit f19597a

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

.github/promote.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
1212
# Update their versions and changelogs according to angular commit guidelines
1313
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
1414

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

2121
# publish to npm

.github/workflows/promote.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
name: promote
1+
name: Promote
22
on:
33
workflow_dispatch:
44
inputs:
5-
core-version:
6-
description: The PatternFly core version
5+
release-version:
6+
description: The version of PatternFly to promote to.
77
required: false
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11-
env:
12-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
13-
CORE_VERSION: ${{ github.event.inputs.core-version }}
14-
RELEASE_VERSION: ${{ github.event.inputs.version }}
15-
GH_TOKEN: ${{ secrets.GH_TOKEN_REDALLEN }}
1611
steps:
1712
- name: Check out project
1813
uses: actions/checkout@v4
1914
with:
20-
# Needs to be an admin token to get around branch protection.
15+
# Pass in an administrator token to get around branch protection.
2116
token: ${{ secrets.GH_TOKEN_REDALLEN }}
2217

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

2823
- name: Deploy to NPM and Github
2924
run: .github/promote.sh
25+
env:
26+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
27+
RELEASE_VERSION: ${{ github.event.inputs.release-version }}

.github/workflows/release.yml

+5-10
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,22 @@ jobs:
1717
name: Deploy release
1818
runs-on: ubuntu-latest
1919
needs: [ci, docs]
20-
env:
21-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22-
# Needs to be an admin token to get around branch protection.
23-
GH_TOKEN: ${{ secrets.GH_TOKEN_REDALLEN }}
24-
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
2520
steps:
2621
- name: Check out project
2722
uses: actions/checkout@v4
2823
with:
24+
# Fetch all history for all branches and tags, which is needed for the release script.
2925
fetch-depth: 0
30-
# Needs to be an admin token to get around branch protection.
26+
# Pass in an administrator token to get around branch protection.
3127
token: ${{ secrets.GH_TOKEN_REDALLEN }}
3228

33-
# Fetches all tags from 'origin' and updates local tags, only fetches the latest commit.
34-
- name: Fetch tags
35-
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
36-
3729
- name: Set up and build project
3830
uses: ./.github/actions/setup-project
3931
with:
4032
skip-build-cache: true
4133

4234
- name: Deploy to NPM and Github
4335
run: .github/release.sh
36+
env:
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}

0 commit comments

Comments
 (0)