|
21 | 21 | - 'yes' |
22 | 22 | - 'no' |
23 | 23 |
|
24 | | -permissions: |
25 | | - contents: read |
26 | | - id-token: write |
27 | | - |
28 | 24 | jobs: |
29 | | - build_stencil_jest_runner: |
| 25 | + build: |
30 | 26 | name: Build |
31 | | - uses: ./.github/workflows/build.yml |
32 | | - |
33 | | - get_dev_version: |
34 | | - if: inputs.devRelease == 'yes' |
35 | | - name: Get Dev Build Version |
36 | 27 | runs-on: ubuntu-latest |
37 | | - outputs: |
38 | | - dev-version: ${{ steps.generate-dev-version.outputs.DEV_VERSION }} |
39 | 28 | steps: |
40 | 29 | - name: Checkout Code |
41 | 30 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
42 | 31 |
|
43 | | - - name: Generate Dev Version |
44 | | - id: generate-dev-version |
45 | | - run: | |
46 | | - PKG_JSON_VERSION=$(cat package.json | jq -r '.version') |
47 | | - GIT_HASH=$(git rev-parse --short HEAD) |
| 32 | + - name: Setup pnpm |
| 33 | + uses: pnpm/action-setup@v4 |
48 | 34 |
|
49 | | - # A unique string to publish Stencil Jest Runner under |
50 | | - # e.g. "2.1.0-dev.1677185104.7c87e34" |
51 | | - DEV_VERSION=$PKG_JSON_VERSION-dev.$(date +"%s").$GIT_HASH |
| 35 | + - name: Setup Node.js |
| 36 | + uses: actions/setup-node@v4 |
| 37 | + with: |
| 38 | + node-version: 22.x |
| 39 | + cache: 'pnpm' |
52 | 40 |
|
53 | | - echo "Using version $DEV_VERSION" |
| 41 | + - name: Install dependencies |
| 42 | + run: pnpm install --frozen-lockfile |
54 | 43 |
|
55 | | - # store a key/value pair in GITHUB_OUTPUT |
56 | | - # e.g. "DEV_VERSION=2.1.0-dev.1677185104.7c87e34" |
57 | | - echo "DEV_VERSION=$DEV_VERSION" >> $GITHUB_OUTPUT |
58 | | - shell: bash |
| 44 | + - name: Build |
| 45 | + run: pnpm run build |
59 | 46 |
|
60 | | - dev_release_stencil_jest_runner: |
| 47 | + - name: Upload build artifacts |
| 48 | + uses: actions/upload-artifact@v4 |
| 49 | + with: |
| 50 | + name: dist |
| 51 | + path: dist/ |
| 52 | + |
| 53 | + release-dev: |
61 | 54 | if: inputs.devRelease == 'yes' |
62 | 55 | name: Publish Dev Build |
63 | | - needs: [build_stencil_jest_runner, get_dev_version] |
| 56 | + needs: build |
64 | 57 | runs-on: ubuntu-latest |
65 | 58 | permissions: |
66 | 59 | id-token: write |
67 | 60 | steps: |
68 | 61 | - name: Checkout Code |
69 | 62 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
70 | 63 |
|
71 | | - - name: Download Build Archive |
72 | | - uses: stenciljs/.github/actions/download-archive@main |
| 64 | + - name: Download build artifacts |
| 65 | + uses: actions/download-artifact@v4 |
| 66 | + with: |
| 67 | + name: dist |
| 68 | + path: dist/ |
| 69 | + |
| 70 | + - name: Setup pnpm |
| 71 | + uses: pnpm/action-setup@v4 |
73 | 72 |
|
74 | | - - uses: stenciljs/.github/actions/publish-npm@main |
| 73 | + - name: Setup Node.js |
| 74 | + uses: actions/setup-node@v4 |
75 | 75 | with: |
76 | | - tag: dev |
77 | | - skip-setup: 'yes' |
78 | | - version: ${{ needs.get_dev_version.outputs.dev-version }} |
| 76 | + node-version: 22.x |
| 77 | + registry-url: 'https://registry.npmjs.org' |
| 78 | + |
| 79 | + - name: Generate dev version |
| 80 | + id: version |
| 81 | + run: | |
| 82 | + PKG_VERSION=$(jq -r '.version' package.json) |
| 83 | + GIT_HASH=$(git rev-parse --short HEAD) |
| 84 | + DEV_VERSION="${PKG_VERSION}-dev.$(date +%s).${GIT_HASH}" |
| 85 | + echo "version=${DEV_VERSION}" >> $GITHUB_OUTPUT |
| 86 | + echo "Publishing dev version: ${DEV_VERSION}" |
79 | 87 |
|
80 | | - prod_release_stencil_jest_runner: |
| 88 | + - name: Set dev version |
| 89 | + run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version |
| 90 | + |
| 91 | + - name: Publish to npm |
| 92 | + run: npm publish --tag dev --provenance --access public |
| 93 | + |
| 94 | + release-prod: |
81 | 95 | if: inputs.devRelease == 'no' |
82 | | - name: Publish Stencil Jest Runner |
83 | | - needs: [build_stencil_jest_runner] |
| 96 | + name: Publish Production Release |
| 97 | + needs: build |
84 | 98 | runs-on: ubuntu-latest |
85 | 99 | permissions: |
86 | 100 | contents: write |
87 | 101 | id-token: write |
88 | 102 | steps: |
89 | 103 | - name: Checkout Code |
90 | 104 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 105 | + with: |
| 106 | + fetch-depth: 0 |
| 107 | + |
| 108 | + - name: Download build artifacts |
| 109 | + uses: actions/download-artifact@v4 |
| 110 | + with: |
| 111 | + name: dist |
| 112 | + path: dist/ |
| 113 | + |
| 114 | + - name: Setup pnpm |
| 115 | + uses: pnpm/action-setup@v4 |
| 116 | + |
| 117 | + - name: Setup Node.js |
| 118 | + uses: actions/setup-node@v4 |
| 119 | + with: |
| 120 | + node-version: 22.x |
| 121 | + registry-url: 'https://registry.npmjs.org' |
| 122 | + |
| 123 | + - name: Configure git |
| 124 | + run: | |
| 125 | + git config user.name "github-actions[bot]" |
| 126 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 127 | +
|
| 128 | + - name: Bump version |
| 129 | + id: version |
| 130 | + run: | |
| 131 | + npm version ${{ inputs.releaseType }} -m "v%s" |
| 132 | + echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT |
| 133 | +
|
| 134 | + - name: Push version commit and tag |
| 135 | + run: git push --follow-tags |
91 | 136 |
|
92 | | - - name: Download Build Archive |
93 | | - uses: stenciljs/.github/actions/download-archive@main |
| 137 | + - name: Publish to npm |
| 138 | + run: npm publish --tag latest --provenance --access public |
94 | 139 |
|
95 | | - - uses: stenciljs/.github/actions/publish-npm@main |
| 140 | + - name: Create GitHub Release |
| 141 | + uses: softprops/action-gh-release@v2 |
96 | 142 | with: |
97 | | - tag: latest |
98 | | - skip-setup: 'yes' |
99 | | - version: ${{ inputs.releaseType }} |
100 | | - github-token: ${{ secrets.GH_ADMIN_PAT }} |
| 143 | + tag_name: v${{ steps.version.outputs.version }} |
| 144 | + name: v${{ steps.version.outputs.version }} |
| 145 | + generate_release_notes: true |
0 commit comments