πŸ“¦ ionic-team / ionic-framework

πŸ“„ action.yml Β· 61 lines
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
61name: 'Release'
description: 'Releases a package'
inputs:
  scope:
    description: 'The package to release. Must match a package specified in lerna.json.'
  version:
    description: 'The type of version to release.'
  tag:
    description: 'The tag to publish to on NPM.'
  preid:
    description: "Prerelease identifier such as 'alpha', 'beta', 'rc', or 'next'. Leave blank to skip prerelease tagging."
  working-directory:
    description: 'The directory of the package.'
  folder:
    default: './'
    description: 'A folder containing a package.json file.'
  node-version:
    description: 'Node.js version to use when publishing.'
    required: false
    default: '24.x'
runs:
  using: 'composite'
  steps:
    - name: 🟒 Configure Node for Publish
      uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
      with:
        node-version: ${{ inputs.node-version }}
        registry-url: 'https://registry.npmjs.org'
        scope: '@ionic'
    # Provenance requires npm 9.5.0+
    - name: πŸ“¦ Install latest npm
      run: npm install -g npm@latest
      shell: bash
    # This ensures the local version of Lerna is installed
    # and that we do not use the global Lerna version
    - name: πŸ•ΈοΈ Install root dependencies
      run: npm ci
      shell: bash
    - name: πŸ“¦ Install Dependencies
      run: npx lerna@5 bootstrap --include-dependencies --scope ${{ inputs.scope }} --ignore-scripts -- --legacy-peer-deps
      shell: bash
      working-directory: ${{ inputs.working-directory }}
    - name: 🏷️ Set Version
      run: |
        if [ -z "${{ inputs.preid }}" ]; then
          npx lerna@5 version ${{ inputs.version }} --yes --exact --no-changelog --no-push --no-git-tag-version
        else
          npx lerna@5 version ${{ inputs.version }} --yes --exact --no-changelog --no-push --no-git-tag-version --preid=${{ inputs.preid }}
        fi
      shell: bash
      working-directory: ${{ inputs.working-directory }}
    - name: πŸ—οΈ Run Build
      run: npm run build
      shell: bash
      working-directory: ${{ inputs.working-directory }}
    - name: πŸš€ Publish to NPM
      run: npm publish ${{ inputs.folder }} --tag ${{ inputs.tag }} --provenance
      shell: bash
      working-directory: ${{ inputs.working-directory }}