@kitschpatrol/repo-config 4.1.1 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/init/.github/workflows/github-release.yml +24 -11
- package/package.json +1 -1
- package/readme.md +16 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name: Create Release
|
|
1
|
+
name: Create GitHub Release
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
@@ -9,6 +9,10 @@ jobs:
|
|
|
9
9
|
build:
|
|
10
10
|
name: Create Release
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
|
+
env:
|
|
13
|
+
ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
|
|
14
|
+
IS_VALID_COMMIT: false
|
|
15
|
+
TAG_NAME: ''
|
|
12
16
|
|
|
13
17
|
steps:
|
|
14
18
|
- name: Checkout
|
|
@@ -16,6 +20,14 @@ jobs:
|
|
|
16
20
|
with:
|
|
17
21
|
fetch-depth: 0
|
|
18
22
|
|
|
23
|
+
- name: Log Token Type
|
|
24
|
+
run: |
|
|
25
|
+
if [ ${{ env.ACCESS_TOKEN }} == ${{ secrets.GITHUB_TOKEN }} ]; then
|
|
26
|
+
echo "🗝️ Authenticated with GitHub Token"
|
|
27
|
+
else
|
|
28
|
+
echo "🔑 Authenticated with Personal Access token"
|
|
29
|
+
fi
|
|
30
|
+
|
|
19
31
|
- name: Validate Tag and Branch
|
|
20
32
|
id: validation
|
|
21
33
|
run: |
|
|
@@ -28,27 +40,28 @@ jobs:
|
|
|
28
40
|
echo "🕊️ Current branch is: $BRANCH"
|
|
29
41
|
fi
|
|
30
42
|
if [[ -z "$TAG" || -z "$BRANCH" ]]; then
|
|
31
|
-
echo "
|
|
32
|
-
echo "
|
|
43
|
+
echo "IS_VALID_COMMIT=false" >> $GITHUB_ENV
|
|
44
|
+
echo "TAG_NAME=''" >> $GITHUB_ENV
|
|
33
45
|
else
|
|
34
|
-
echo "
|
|
35
|
-
echo "
|
|
46
|
+
echo "IS_VALID_COMMIT=true" >> $GITHUB_ENV
|
|
47
|
+
echo "TAG_NAME=$TAG" >> $GITHUB_ENV
|
|
36
48
|
fi
|
|
37
49
|
|
|
38
50
|
- name: Release Notes
|
|
39
|
-
if: env.
|
|
51
|
+
if: env.IS_VALID_COMMIT == 'true'
|
|
40
52
|
id: release-notes
|
|
41
53
|
uses: Bullrich/generate-release-changelog@master
|
|
42
54
|
|
|
43
55
|
- name: Release
|
|
44
|
-
if: env.
|
|
56
|
+
if: env.IS_VALID_COMMIT == 'true'
|
|
45
57
|
id: release
|
|
46
58
|
uses: softprops/action-gh-release@v1
|
|
47
59
|
with:
|
|
60
|
+
token: ${{ env.ACCESS_TOKEN }}
|
|
48
61
|
draft: false
|
|
49
62
|
prerelease: false
|
|
50
|
-
name: ${{ env.
|
|
51
|
-
tag_name: ${{ env.
|
|
63
|
+
name: ${{ env.TAG_NAME }}
|
|
64
|
+
tag_name: ${{ env.TAG_NAME }}
|
|
52
65
|
body: |
|
|
53
66
|
${{ steps.release-notes.outputs.changelog }}
|
|
54
67
|
files: |
|
|
@@ -61,8 +74,8 @@ jobs:
|
|
|
61
74
|
changelog.md
|
|
62
75
|
|
|
63
76
|
- name: Log Release Details
|
|
64
|
-
if: env.
|
|
77
|
+
if: env.IS_VALID_COMMIT == 'true'
|
|
65
78
|
run: |
|
|
66
|
-
echo "📦 Successfully released: ${{ env.
|
|
79
|
+
echo "📦 Successfully released: ${{ env.TAG_NAME }}"
|
|
67
80
|
echo "🔗 Release URL: ${{ steps.release.outputs.url }}"
|
|
68
81
|
echo "🪪 Release ID: ${{ steps.release.outputs.id }}"
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -6,7 +6,7 @@ It's a `pnpm`-flavored shared config with some essential files for a fresh repo.
|
|
|
6
6
|
|
|
7
7
|
This includes the following:
|
|
8
8
|
|
|
9
|
-
- [`.npmrc`](https://pnpm.io/npmrc) with hoisting patterns for
|
|
9
|
+
- [`.npmrc`](https://pnpm.io/npmrc) with hoisting patterns for \`shared-config\`\` tool access
|
|
10
10
|
- `.gitignore` with typical patterns
|
|
11
11
|
- `.vscode` extension recommendations (additional settings and recommendations come from other `shared-config` packages)
|
|
12
12
|
- `.github` folder with a workflow for turning vX.X.X tags into GitHub releases
|
|
@@ -42,3 +42,18 @@ Optionally, you can install the package if you think you'll ever want to regener
|
|
|
42
42
|
```sh
|
|
43
43
|
pnpm exec repo-config --init
|
|
44
44
|
```
|
|
45
|
+
|
|
46
|
+
### GitHub Configuration
|
|
47
|
+
|
|
48
|
+
There are two options for authenticating the release workflow action:
|
|
49
|
+
|
|
50
|
+
#### Github Token
|
|
51
|
+
|
|
52
|
+
1. Ensure that read / write permissions are set for actions on the repository under Settings → Actions → General → Workflow permissions.
|
|
53
|
+
|
|
54
|
+
#### Personal Access token
|
|
55
|
+
|
|
56
|
+
If you want releases to come from your account instead of `github_actions`, then:
|
|
57
|
+
|
|
58
|
+
1. Create a [fine-grained personal access token](https://github.com/settings/tokens?type=beta) in your GitHub account with the "Contents" repository permission set to "Read and Write".
|
|
59
|
+
2. Add the token as a secret to the repository under the key `PERSONAL_ACCESS_TOKEN`.
|