Skip to content

Commit 1ec7dc7

Browse files
authored
Merge pull request #845 from puppetlabs/CAT-1422-update_workflows
(CAT-1422) - Bring Workflows Up-to-date
2 parents 2503911 + 6f9874b commit 1ec7dc7

File tree

5 files changed

+173
-43
lines changed

5 files changed

+173
-43
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/nightly.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: nightly
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
node-version: [18]
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: 'setup node: ${{ matrix.node-version }} platform: ${{ matrix.os }}'
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
23+
- name: setup linux
24+
if: runner.os == 'Linux'
25+
run: |
26+
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & echo ">>> Started xvfb";
27+
wget https://apt.puppetlabs.com/puppet6-release-trusty.deb;
28+
sudo dpkg -i puppet6-release-trusty.deb;
29+
sudo apt-get update -y;
30+
sudo apt-get install pdk -y;
31+
pdk --version;
32+
33+
- name: setup macos
34+
if: runner.os == 'macOS'
35+
run: |
36+
export HOMEBREW_NO_AUTO_UPDATE=1;
37+
brew install --cask puppetlabs/puppet/pdk;
38+
/opt/puppetlabs/pdk/bin/pdk --version;
39+
40+
- name: setup windows
41+
if: runner.os == 'Windows'
42+
run: |
43+
choco install pdk -y
44+
45+
- name: Install psake
46+
shell: pwsh
47+
run: Install-Module psake -Force
48+
49+
- name: npm install
50+
shell: pwsh
51+
run: |
52+
npm install -g vsce --silent;
53+
npm install --silent;
54+
55+
- name: npm build
56+
shell: pwsh
57+
run: |
58+
invoke-psake -taskList 'build'
59+
60+
- name: npm test
61+
env:
62+
BUILD_VERSION: '0.99.${{ github.event.number }}'
63+
VSCODE_BUILD_VERBOSE: true
64+
DISPLAY: ':99.0'
65+
shell: pwsh
66+
run: |
67+
npm test --silent
68+
69+
- name: vsce package
70+
if: runner.os == 'Linux'
71+
env:
72+
BUILD_VERSION: '0.99.${{ github.event.number }}'
73+
shell: pwsh
74+
run: |
75+
invoke-psake -properties @{ packageVersion = $env:BUILD_VERSION } -tasklist bump
76+
mkdir artifacts
77+
vsce package --out artifacts/puppet-vscode-$env:BUILD_VERSION.vsix
78+
79+
- name: upload vsix
80+
if: runner.os == 'Linux'
81+
uses: actions/upload-artifact@master
82+
with:
83+
name: 'puppet-vscode'
84+
path: artifacts

.github/workflows/release.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
name: release
22

33
on:
4-
push:
5-
tags:
6-
- '[0-9].[0-9]+.[0-9]+' # Push events matching all semantic versioning tags, i.e. 0.26.01, 1.0, v20.15.10
4+
workflow_dispatch:
75

86
env:
9-
NODE_VERSION: '14.x'
7+
NODE_VERSION: '18.x'
108

119
jobs:
1210
release:
1311
runs-on: ubuntu-latest
1412
steps:
15-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1614
- name: Node ${{ env.NODE_VERSION }}
1715
uses: actions/setup-node@v3
1816
with:
@@ -34,29 +32,21 @@ jobs:
3432
- name: Set vsix version
3533
id: vsce
3634
run: |
37-
echo "::set-output name=version::$(cat package.json | jq -r .version)"
35+
echo "version=$(cat package.json | jq -r .version)" >> $GITHUB_OUTPUT
3836
39-
- name: Create Github Release
40-
id: create_github_release
41-
uses: actions/create-release@v1
37+
- name: "Generate release notes"
38+
run: |
39+
export GH_HOST=github.com
40+
gh extension install chelnak/gh-changelog
41+
gh changelog get --latest > OUTPUT.md
4242
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
with:
45-
tag_name: ${{ github.ref }}
46-
release_name: ${{ steps.vsce.outputs.version }}
47-
draft: false
48-
prerelease: false
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4944

50-
- name: Upload vsix
51-
id: upload-release-asset
52-
uses: actions/upload-release-asset@v1
45+
- name: Create Github release
46+
run: |
47+
gh release create v${{ steps.vsce.outputs.version }} ./puppet-vscode-${{ steps.vsce.outputs.version }}.vsix --title v${{ steps.vsce.outputs.version }} -F OUTPUT.md
5348
env:
5449
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
with:
56-
upload_url: ${{ steps.create_github_release.outputs.upload_url }}
57-
asset_path: ./puppet-vscode-${{ steps.vsce.outputs.version }}.vsix
58-
asset_name: puppet-vscode-${{ steps.vsce.outputs.version }}.vsix
59-
asset_content_type: application/zip
6050

6151
- name: Publish Extension
6252
id: publish-release-asset

.github/workflows/release_prep.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: release_prep
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to released.'
8+
required: true
9+
default: '0.0.0'
10+
11+
jobs:
12+
release_prep:
13+
name: "Release Prep"
14+
runs-on: "ubuntu-latest"
15+
env:
16+
NODE_VERSION: "18"
17+
18+
steps:
19+
- name: "Checkout"
20+
uses: "actions/checkout@v4"
21+
with:
22+
clean: true
23+
fetch-depth: 0
24+
25+
- name: Node ${{ env.NODE_VERSION }}
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ env.NODE_VERSION }}
29+
30+
- name: "Update Version"
31+
run: |
32+
current_version=$(jq --raw-output .version package.json)
33+
# Update version in package.json, only matching first occurrence
34+
sed -i "0,/$current_version/s//${{ github.event.inputs.version }}/" $(find . -name 'package.json')
35+
36+
- name: "Generate package-lock.json"
37+
run: |
38+
npm install
39+
npm update --package-lock-only
40+
41+
- name: "Generate changelog"
42+
run: |
43+
export GH_HOST=github.com
44+
gh extension install chelnak/gh-changelog
45+
gh changelog new --next-version v${{ github.event.inputs.version }}
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: "Commit changes"
50+
run: |
51+
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
52+
git config --local user.name "GitHub Actions"
53+
git add .
54+
git commit -m "Release prep v${{ github.event.inputs.version }}"
55+
56+
- name: "Create pull request"
57+
uses: "peter-evans/create-pull-request@v5"
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
commit-message: "Release prep v${{ github.event.inputs.version }}"
61+
branch: "release-prep"
62+
delete-branch: true
63+
title: "Release prep v${{ github.event.inputs.version }}"
64+
base: "main"
65+
body: |
66+
Automated release-prep from commit ${{ github.sha }}.
67+
labels: "maintenance"

.github/workflows/vscode-ci.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,44 @@ on:
44
pull_request:
55
branches:
66
- main
7-
push:
8-
branches:
9-
- main
7+
workflow_dispatch:
108

119
jobs:
1210
build:
1311
runs-on: ${{ matrix.os }}
1412
strategy:
1513
matrix:
16-
node-version: [14]
14+
node-version: [18]
1715
os: [ubuntu-latest, windows-latest, macos-latest]
1816

1917
steps:
20-
- uses: actions/checkout@v1
18+
- uses: actions/checkout@v4
2119
- name: 'setup node: ${{ matrix.node-version }} platform: ${{ matrix.os }}'
2220
uses: actions/setup-node@v3
2321
with:
24-
fetch-depth: 1
2522
node-version: ${{ matrix.node-version }}
2623

2724
- name: setup linux
25+
if: runner.os == 'Linux'
2826
run: |
2927
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & echo ">>> Started xvfb";
3028
wget https://apt.puppetlabs.com/puppet6-release-trusty.deb;
3129
sudo dpkg -i puppet6-release-trusty.deb;
32-
sudo apt-get update;
33-
sudo apt-get install pdk;
30+
sudo apt-get update -y;
31+
sudo apt-get install pdk -y;
3432
pdk --version;
35-
if: runner.os == 'Linux'
3633
3734
- name: setup macos
35+
if: runner.os == 'macOS'
3836
run: |
3937
export HOMEBREW_NO_AUTO_UPDATE=1;
4038
brew install --cask puppetlabs/puppet/pdk;
4139
/opt/puppetlabs/pdk/bin/pdk --version;
42-
if: runner.os == 'macOS'
4340
4441
- name: setup windows
45-
run: |
46-
choco install pdk
4742
if: runner.os == 'Windows'
43+
run: |
44+
choco install pdk -y
4845
4946
- name: Install psake
5047
shell: pwsh

0 commit comments

Comments
 (0)