-
Notifications
You must be signed in to change notification settings - Fork 17
66 lines (56 loc) · 1.98 KB
/
pack-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Pack Package
on:
workflow_call:
inputs:
package-name:
description: 'Name of the package to pack'
required: true
type: string
jobs:
pack-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: get version
id: version
uses: notiz-dev/[email protected]
with:
path: "Packages/${{inputs.package-name}}/package.json"
prop_path: "version"
- run: echo ${{steps.version.outputs.prop}}
- name: Set Environment Variables
run: |
echo "zipFile=${{ inputs.package-name }}-${{ steps.version.outputs.prop }}".zip >> $GITHUB_ENV
- name: Create Zip
uses: thedoctor0/[email protected]
with:
type: "zip"
directory: "Packages/${{inputs.package-name}}/"
filename: "../../${{env.zipFile}}" # make the zip file two directories up, since we start two directories in above
- name: Add Summary
run: |
echo "# Package ${{inputs.package-name}}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "saved as"
echo "" >> $GITHUB_STEP_SUMMARY
echo "- ${{ env.zipFile }}" >> $GITHUB_STEP_SUMMARY
- name: Make Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: "${{inputs.package-name}}@v${{ steps.version.outputs.prop }}"
generate_release_notes: true
draft: true
files: |
${{ env.zipFile }}
- name: Make Pre-Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/heads/dev')
with:
tag_name: "${{inputs.package-name}}@v${{ steps.version.outputs.prop }}"
prerelease: true
draft: true
generate_release_notes: true
files: |
${{ env.zipFile }}