Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/eslint-plugin-qunit-…
Browse files Browse the repository at this point in the history
…8.1.1
  • Loading branch information
patricklx authored Jul 13, 2024
2 parents 1c2fa40 + 536aa9e commit 9d750dd
Show file tree
Hide file tree
Showing 7 changed files with 172 additions and 72 deletions.
54 changes: 1 addition & 53 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: pnpm install, build, and deploy docs
working-directory: ./test-app
run: |
mkdir ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
Expand All @@ -150,56 +151,3 @@ jobs:
env:
CI: true
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
- name: deploy pnpm
if: github.ref == 'refs/heads/main'
run: |
version=$(cat package.json | jq -r '.version')
TAG=v$version
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "tag exists";
else
pnpm run precompile
cd precompiled
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
pnpm run ts:build-types
pnpm publish || echo "already published"
fi
env:
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
- name: create tag
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_COMMIT: ${{ github.sha }}
run: |
version=$(cat package.json | jq -r '.version')
TAG=v$version
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "tag exists";
else
pnpm i -g lerna-changelog
export GITHUB_AUTH=$GITHUB_TOKEN
export changelog=$(lerna-changelog --next-version=$version)
echo -e "# Changelog\n\n$changelog\n$(tail --lines=+2 CHANGELOG.md)" > CHANGELOG.md
git add CHANGELOG.md
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "update changelog"
git tag $TAG
git push
git push --tags
fi
- name: Create a Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version=$(cat package.json | jq -r '.version')
TAG=v$version
url="https://api.github.com/repos/ibm/carbon-components-ember/releases"
exists=$(curl -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" $url | jq ".[] | select(.tag_name == \"$TAG\") | .id")
if [[ -z $exists ]]; then
curl -X POST -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" $url -d "{ \"tag_name\": \"$TAG\", \"name\": \"$TAG\", \"body\": \"$changelog\", \"draft\": false, \"prerelease\": false}"
else
echo "release already exists";
fi;
31 changes: 17 additions & 14 deletions .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v3
with:
version: 8

- name: install pnpm
run: npm i -g pnpm

- run: pnpm install --frozen-lockfile

- name: "Generate Explanation and Prep Changelogs"
id: explanation
run: |
set +e
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
if [ $? -ne 0 ]; then
echo 'text<<EOF' >> $GITHUB_OUTPUT
Expand All @@ -81,13 +81,16 @@ jobs:
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

- uses: peter-evans/create-pull-request@v6
with:
commit-message: "Prepare Release using 'release-plan'"
labels: "internal"
branch: release-preview
title: Prepare Release
body: |
- name: create pull request
run: node ./scripts/create-pull-request.js
env:
INPUT_COMMIT-MESSAGE: "Prepare Release using 'release-plan'"
INPUT_LABELS: "internal"
INPUT_BRANCH: release-preview
INPUT_TITLE: Prepare Release
INPUT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_AUTHOR: '${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>'
INPUT_BODY: |
This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR 👍
-----------------------------------------
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ jobs:
node-version: 18
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v3
with:
version: 8

- name: install pnpm
run: npm i -g npm
- run: pnpm install --frozen-lockfile
- name: npm publish
run: pnpm release-plan publish

env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
!README.md
!.github
!.github/**/*
!scripts
!scripts/**/*

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@
"babel-plugin-ember-template-compilation": "^2.2.5",
"ember-source": "^5.9.0"
}
},
"dependencies": {
"create-pull-request": "github:peter-evans/create-pull-request#v6.1.0",
"yaml": "^2.4.5"
}
}
Loading

0 comments on commit 9d750dd

Please sign in to comment.