Skip to content

Commit b2f5ccb

Browse files
authored
Merge pull request #13 from knaopel/v1.19.0
Update with multi-step workflow
2 parents d3531bc + e9a7970 commit b2f5ccb

File tree

2 files changed

+76
-26
lines changed

2 files changed

+76
-26
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release SPFx package
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tag_name:
7+
required: true
8+
type: string
9+
artifact_name:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
release:
15+
name: Release SPFx Package
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Download Published Artifact
19+
uses: actions/download-artifact@v4
20+
with:
21+
name: ${{ inputs.artifact_name }}
22+
23+
- name: Release Package
24+
uses: softprops/action-gh-release@v2
25+
continue-on-error: true
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
files: spfx-react-jest-testing.sppkg
30+
tag_name: ${{ inputs.tag_name }}
31+
name: Release v${{ inputs.tag_name }}

.github/workflows/test-and-build.yml

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,23 @@ jobs:
6464
runs-on: ubuntu-latest
6565
needs: test
6666
if: ${{ github.event_name == 'push' }}
67+
outputs:
68+
tag_name: ${{ steps.json_properties.outputs.solution.version }}
6769
steps:
6870
- name: Check out git repository
6971
uses: actions/checkout@v4
7072

73+
- name: Get Package Properties
74+
id: json_properties
75+
uses: zoexx/github-action-json-file-properties@release
76+
with:
77+
file_path: config/package-solution.json
78+
79+
- name: Tag Repo
80+
run: |
81+
git tag -f v${{ steps.json_properties.outputs.solution.version }}
82+
git push --tags --force
83+
7184
- name: Install Node.js v${{ env.NODE_VERSION }}, and NPM
7285
uses: actions/setup-node@v4
7386
with:
@@ -90,30 +103,36 @@ jobs:
90103
if-no-files-found: error
91104

92105
release:
93-
name: Release SPFx solution
94-
runs-on: ubuntu-latest
106+
name: Release sub-job
95107
needs: package
96-
steps:
97-
- name: Check out git repository
98-
uses: actions/checkout@v4
99-
100-
- name: Download published artifact
101-
uses: actions/download-artifact@v4
102-
with:
103-
name: sp-pkg
104-
105-
- name: Get Package Properties
106-
id: json_properties
107-
uses: zoexx/github-action-json-file-properties@release
108-
with:
109-
file_path: config/package-solution.json
110-
111-
- name: Release SPFx Package
112-
uses: softprops/action-gh-release@v2
113-
continue-on-error: true
114-
env:
115-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116-
with:
117-
files: spfx-react-jest-testing.sppkg
118-
tag_name: ${{ steps.json_properties.solution.version }}
119-
name: Release v${{ steps.json_properties.solution.version }}
108+
uses: ./.github/workflows/release.yml
109+
with:
110+
tag_name: ${{ needs.package.tag_name }}
111+
artifact_name: sp-pkg
112+
# name: Release SPFx solution
113+
# runs-on: ubuntu-latest
114+
# needs: package
115+
# steps:
116+
# - name: Check out git repository
117+
# uses: actions/checkout@v4
118+
119+
# - name: Download published artifact
120+
# uses: actions/download-artifact@v4
121+
# with:
122+
# name: sp-pkg
123+
124+
# - name: Get Package Properties
125+
# id: json_properties
126+
# uses: zoexx/github-action-json-file-properties@release
127+
# with:
128+
# file_path: config/package-solution.json
129+
130+
# - name: Release SPFx Package
131+
# uses: softprops/action-gh-release@v2
132+
# continue-on-error: true
133+
# env:
134+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135+
# with:
136+
# files: spfx-react-jest-testing.sppkg
137+
# tag_name: ${{ steps.json_properties.solution.version }}
138+
# name: Release v${{ steps.json_properties.solution.version }}

0 commit comments

Comments
 (0)