|
| 1 | +name: 'Production Release (TEST)' |
| 2 | + |
| 3 | +on: |
| 4 | +# TODO(NOW): remove this |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - 'rw/prod-release-flow' |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + version: |
| 11 | + required: true |
| 12 | + type: choice |
| 13 | + description: Which version should be published? |
| 14 | +# TODO(NOW): Remove |
| 15 | + default: prepatch |
| 16 | + options: |
| 17 | + - prerelease |
| 18 | + - prepatch |
| 19 | + - preminor |
| 20 | + - premajor |
| 21 | + - patch |
| 22 | + - minor |
| 23 | + - major |
| 24 | + |
| 25 | +jobs: |
| 26 | + build_stencil_store: |
| 27 | + name: Build |
| 28 | + uses: ./.github/workflows/build.yml |
| 29 | + |
| 30 | + release_store_stencil: |
| 31 | + name: Publish Dev Build |
| 32 | + runs-on: ubuntu-latest |
| 33 | + needs: [ build_stencil_store ] |
| 34 | + permissions: |
| 35 | + contents: write |
| 36 | + id-token: write |
| 37 | + steps: |
| 38 | + # Log the input from GitHub Actions for easy traceability |
| 39 | + - name: Log GitHub Input |
| 40 | + run: | |
| 41 | + echo "Version: ${{ inputs.version }}" |
| 42 | + shell: bash |
| 43 | + |
| 44 | + - name: Checkout Code |
| 45 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 46 | + |
| 47 | + - name: Get Core Dependencies |
| 48 | + uses: ./.github/workflows/actions/get-core-dependencies |
| 49 | + |
| 50 | +# - name: Build |
| 51 | +# uses: ./.github/workflows/build.yml |
| 52 | + |
| 53 | + - name: Download Build Archive |
| 54 | + uses: ./.github/workflows/actions/download-archive |
| 55 | + with: |
| 56 | + name: stencil-store |
| 57 | + path: . |
| 58 | + filename: stencil-store-build.zip |
| 59 | + |
| 60 | + - name: Bump the Version |
| 61 | +# TODO(NOW): Fix |
| 62 | + run: npm version prepatch --no-git-tag |
| 63 | + |
| 64 | + - name: Log Generated Changes |
| 65 | + run: git --no-pager diff |
| 66 | + shell: bash |
| 67 | + |
| 68 | + # Commit changes resulting from bumping the version |
| 69 | + # Note: The commit message is the result of performing the following actions: |
| 70 | + # 1. Searching `package.json` for the string "version" |
| 71 | + # 2. Assuming the first entry returned corresponds to this project's the version string |
| 72 | + # 3. Stripping out all double quotes and commas from the version itself ($2 in awk corresponds to only the version here) |
| 73 | + # 4. Printing the version string, prepended with a 'v' for 'version' |
| 74 | + - name: Commit Release Preparations |
| 75 | + run: | |
| 76 | + git config user.name "Stencil Release Bot (on behalf of ${{ github.actor }})" |
| 77 | + git config user.email "stencil-release-bot@ionic.io" |
| 78 | + git add . |
| 79 | + git commit -m "$(cat package.json | grep version | head -n 1 | awk '{ gsub(/"|,/, "", $2); print "v"$2}')" |
| 80 | + env: |
| 81 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + shell: bash |
| 83 | + |
| 84 | + |
| 85 | + - name: Push Branch to GitHub |
| 86 | + run: | |
| 87 | + git push origin |
| 88 | + env: |
| 89 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 90 | + |
| 91 | + - name: Upload Build Artifacts |
| 92 | + uses: ./.github/workflows/actions/upload-archive |
| 93 | + with: |
| 94 | +# TODO(NOW): I just renamed this |
| 95 | + name: stencil-store-for-publish |
| 96 | + output: stencil-store-build-for-publish.zip |
| 97 | + paths: ./dist/ |
0 commit comments