Skip to content

Commit 15c1c0b

Browse files
committed
Update deploy workflow Together I've defeated for the first time that I'm vivid
1 parent a429104 commit 15c1c0b

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

.github/workflows/_deploy.yml

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@ jobs:
1818
working-directory: ./packages/${{ inputs.package-name }}
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
2222

23-
- run: |
23+
- uses: actions/setup-node@v3
24+
with:
25+
node-version: '16.x'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
- name: Summary Head
29+
run: |
2430
echo "# Deployment Summary" >> $GITHUB_STEP_SUMMARY
2531
echo "Date: $(date) " >> $GITHUB_STEP_SUMMARY
2632
echo "Run ID: ${{ github.run_id }} " >> $GITHUB_STEP_SUMMARY
2733
echo "Run Number: ${{ github.run_number }} " >> $GITHUB_STEP_SUMMARY
2834
echo "Run Attempt: ${{ github.run_attempt }} " >> $GITHUB_STEP_SUMMARY
29-
30-
- uses: actions/setup-node@v3
31-
with:
32-
node-version: '16.x'
33-
registry-url: 'https://registry.npmjs.org'
34-
35-
- run: |
3635
echo "Node Version: $(node --version) - NPM Version: $(npm --version) " >> $GITHUB_STEP_SUMMARY
3736
echo "---" >> $GITHUB_STEP_SUMMARY
3837
echo "Package Name: **${{ inputs.package-name }}** " >> $GITHUB_STEP_SUMMARY
3938
39+
4040
- name: Read package.json
4141
id: package-json
4242
run: |
4343
echo "PACKAGE_JSON<<GH-EOF" >> $GITHUB_ENV
4444
cat ./package.json >> $GITHUB_ENV
4545
echo "GH-EOF" >> $GITHUB_ENV
46-
47-
- run: |
46+
- name: "Read package version"
47+
run: |
4848
version=${{ fromJson(env.PACKAGE_JSON).version }}
4949
escaped_version=$(printf '%s\n' "$version" | sed -e 's/[]\/$*.^[]/\\&/g')
5050
echo "VERSION=$version" >> $GITHUB_ENV
@@ -61,14 +61,12 @@ jobs:
6161
run: npm run test
6262

6363
- name: Publish
64-
run: npm publish --access=public
65-
env:
66-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
67-
68-
- run: |
64+
run: |
65+
npm publish --access=public
6966
echo "" >> $GITHUB_STEP_SUMMARY
7067
echo "Successfully published to the [NPM registry](https://www.npmjs.com/package/@sourcelib/${{inputs.package-name}}/v/$VERSION)" >> $GITHUB_STEP_SUMMARY
71-
68+
env:
69+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7270

7371
- name: Get Changelog
7472
id: changelog
@@ -84,27 +82,25 @@ jobs:
8482
changelog2="${changelog2//$'`'/'\`'}"
8583
changelog2="${changelog2//$'"'/'\"'}"
8684
changelog2="${changelog2//"'"/"'\''"}"
87-
echo "escaped=$changelog" >> $GITHUB_OUTPUT
88-
echo "unescaped=$changelog1" >> $GITHUB_OUTPUT
89-
echo "doubleescaped=$changelog2" >> $GITHUB_OUTPUT
90-
echo "---" >> $GITHUB_STEP_SUMMARY
91-
echo $escaped >> $GITHUB_STEP_SUMMARY
85+
echo "CL_ESCAPED=$changelog" >> $GITHUB_ENV
86+
echo "CL_UNESCAPED=$changelog1" >> $GITHUB_ENV
87+
echo "CL_DOUBLEESCAPED=$changelog2" >> $GITHUB_ENV
9288
9389
- name: Github Release
9490
id: release
9591
uses: softprops/action-gh-release@v1
9692
with:
97-
body: "${{steps.changelog.outputs.unescaped}}"
93+
body: "${{env.CL_UNESCAPED}}"
9894
tag_name: "${{inputs.package-name}}-${{env.VERSION}}"
9995

10096
- name: Prepare Discord Message
10197
id: discord-msg
10298
working-directory: ./
10399
run: |
104100
awk '{
105-
gsub("#VERSION#","$VERSION",$0);
101+
gsub("#VERSION#","${{env.VERSION}}",$0);
106102
gsub("#PACKAGE#","${{inputs.package-name}}",$0);
107-
gsub("#DESCRIPTION#","${{steps.changelog.outputs.doubleescaped}}",$0);
103+
gsub("#DESCRIPTION#","${{env.CL_DOUBLEESCAPED}}",$0);
108104
print $0;
109105
}' ./.github/workflows/deploy_discord_message.json > ./.github/workflows/deploy_discord_message2.json
110106
@@ -115,5 +111,6 @@ jobs:
115111
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
116112
raw-data: "./.github/workflows/deploy_discord_message2.json"
117113

118-
- run: |
114+
- name: Summary Footer
115+
run: |
119116
echo "Discord Message sent successfully" >> $GITHUB_STEP_SUMMARY

packages/kv/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
66

77
The versions in this file adhere to [semantic versioning](https://semver.org/).
88

9+
## [0.3.3]
10+
11+
- This is a test release
12+
913
## [0.3.2]
1014

1115
- This is a test release

packages/kv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sourcelib/kv",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Source Engine KeyValue file parser and tokenizer library",
55
"main": "lib/main.js",
66
"scripts": {

0 commit comments

Comments
 (0)