Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Setup v5 LTS CI infrastructure (#12455) #12459

Merged
merged 11 commits into from
Oct 30, 2023
52 changes: 52 additions & 0 deletions .github/workflows/callable-npm-publish-lts-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release LTS version to npm and update repository

on:
workflow_call:
inputs:
target:
required: true
type: string

jobs:
deploy:
name: Publish to Amplify Package
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
path: amplify-js
token: ${{ secrets.GH_TOKEN_AMPLIFY_JS_WRITE }}

- name: Setup node and build the repository
uses: ./amplify-js/.github/actions/node-and-build

- name: Run npm publish
uses: ./amplify-js/.github/actions/npm-publish
with:
target: ${{ inputs.target }}
npm_token: ${{ secrets.NPM_TOKEN }}
github_user: ${{ vars.GH_USER}}
github_email: ${{ vars.GH_EMAIL}}

- name: Set github commit user
env:
GITHUB_EMAIL: ${{ vars.GH_EMAIL }}
GITHUB_USER: ${{ vars.GH_USER }}
run: |
git config --global user.email $GITHUB_EMAIL
git config --global user.name $GITHUB_USER

- name: Update API documentation
working-directory: ./amplify-js
run: |
yarn run docs
git add ./docs/api/
git commit -m "chore(release): update API docs [ci skip]"

- name: Push post release changes
working-directory: ./amplify-js
env:
TARGET_BRANCH: ${{ inputs.target }}
run: |
git push origin $TARGET_BRANCH
2 changes: 1 addition & 1 deletion .github/workflows/callable-npm-publish-preid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
ALLOW_PROTECTED_PREIDS: ${{ inputs.allow-protected-preid }}
PREID: ${{ inputs.preid }}
FORBIDDEN_PREIDS: latest
PROTECTED_PREIDS: next unstable
PROTECTED_PREIDS: next unstable stable-5 stable-4
run: |
echo "Testing to see if $PREID is in the forbidden list ($FORBIDDEN_PREIDS)"
for e in $FORBIDDEN_PREIDS; do [[ $PREID == $e ]] && echo "$PREID is forbidden from preid release" && exit 1; done
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/push-lts-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Push - release from LTS branch to LTS dist tag

concurrency:
# group name unique for push to push-latest-release
group: push-lts-release-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- v5-stable

jobs:
e2e:
secrets: inherit
uses: ./.github/workflows/callable-release-verification.yml
release:
needs:
- e2e
permissions:
contents: write
secrets: inherit
uses: ./.github/workflows/callable-npm-publish-lts-release.yml
with:
target: v5-stable # TODO Update this to support other LTS branches in the future
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"publish:preid": "./scripts/preid-env-vars-exist.sh && lerna publish --canary --force-publish --dist-tag=${PREID_PREFIX} --preid=${PREID_PREFIX}${PREID_HASH_SUFFIX} --yes",
"publish:main": "lerna publish --canary --force-publish --dist-tag=unstable --preid=unstable${PREID_HASH_SUFFIX} --yes",
"publish:release": "lerna publish from-package --dist-tag=v6 --message 'chore(release): Publish [ci skip]' --yes",
"publish:v5-stable": "lerna publish --conventional-commits --yes --dist-tag=stable-5 --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:verdaccio": "lerna publish --canary --force-publish --no-push --dist-tag=unstable --preid=unstable --yes",
"ts-coverage": "lerna run ts-coverage",
"prepare": "./scripts/set-preid-versions.sh"
Expand Down
Loading