Skip to content

Commit 625e6e5

Browse files
committed
(MAINT) Simplify release
Prior to this commit the release workflow had three sub jobs. This is not required so this commit consolidates all steps in to a single job.
1 parent 7067ad5 commit 625e6e5

File tree

1 file changed

+20
-41
lines changed

1 file changed

+20
-41
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,13 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
github-release:
8-
name: "create release"
7+
release:
8+
name: "release"
99
runs-on: "ubuntu-latest"
1010
if: github.repository_owner == 'puppetlabs'
1111

1212
steps:
13-
- name: "checkout"
14-
uses: "actions/checkout@v3"
15-
with:
16-
ref: ${{ github.ref }}
17-
clean: true
18-
fetch-depth: 0
19-
20-
- name: "get version"
21-
id: "get_version"
22-
run: |
23-
echo "::set-output name=version::$(jq --raw-output .version metadata.json)"
2413

25-
- name: "create release"
26-
run: |
27-
gh release create "${{ steps.get_version.outputs.version }}"
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
31-
publish-gem:
32-
name: "publish gem"
33-
runs-on: "ubuntu-latest"
34-
needs: "github-release"
35-
steps:
3614
- name: "checkout"
3715
uses: "actions/checkout@v3"
3816
with:
@@ -46,37 +24,38 @@ jobs:
4624
ruby-version: 2.7
4725
bundler-cache: true
4826

49-
- name: "build"
27+
- name: "get version"
28+
id: "get_version"
29+
run: |
30+
echo "::set-output name=version::$(jq --raw-output .version metadata.json)"
31+
32+
- name: "build gem"
5033
run: |
5134
bundle exec rake build
5235
53-
- name: "publish"
36+
- name: "publish gem"
5437
run: |
55-
bundle exec rake push
38+
gem push ./pkg/*.gem
5639
env:
5740
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
5841

59-
publish-module:
60-
name: "publish module"
61-
runs-on: ubuntu-20.04
62-
needs: publish-gem
63-
steps:
64-
- name: "checkout"
65-
uses: "actions/checkout@v3"
66-
with:
67-
ref: ${{ github.ref }}
68-
clean: true
69-
70-
- name: "update readme"
42+
- name: "update module readme"
7143
run: |
7244
mv pwshlib.md README.md
7345
74-
- name: "build"
46+
- name: "build module"
7547
uses: "docker://puppet/pdk:latest"
7648
with:
7749
args: 'build'
7850

79-
- name: "publish"
51+
- name: "publish module"
8052
uses: "docker://puppet/pdk:latest"
8153
with:
8254
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'
55+
56+
- name: "create release"
57+
run: |
58+
gh release create v${{ steps.get_version.outputs.version }} ./pkg/*.gem ./pkg/*.tar.gz --title v${{ steps.get_version.outputs.version }}
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+

0 commit comments

Comments
 (0)