Skip to content

Commit

Permalink
fix: Attempt to update manifest.json, attach zip
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Feb 3, 2022
1 parent 2607d2f commit 6e4d133
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,45 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: release-please-action
- uses: actions/checkout@v2

# If we didn't create a release, we may have created or updated a PR.
- run: |
# Check out the branch that release-please created, if it exists.
git fetch
git checkout release-please--branches--ci || exit 0
# If it does exist, update manifest.json in the PR branch.
# release-please can't update it for us yet. See:
# https://github.com/googleapis/release-please/issues/1171
VERSION=$(jq -r .version package.json)
cp manifest.json manifest.json.orig
jq -r ".version = \"$VERSION\"" manifest.json.orig > manifest.json
git add manifest.json
# Emulate the author of the existing commit (the bot).
git config user.email "$(git log -n 1 --format='%ae')"
git config user.name "$(git log -n 1 --format='%an')"
# Update the PR.
git commit --amend --no-edit
git push -f
if: ${{ ! steps.release.outputs.release_created }}
# If we did create a release, we should attach the extension's zip file
# to it.
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: npm run build
if: ${{ steps.release.outputs.release_created }}
- uses: svenstaro/upload-release-action@483c1e56f95e88835747b1c7c60581215016cbf2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag_name }}
file: eme_logger-*.zip
file_glob: true
overwrite: true
if: ${{ steps.release.outputs.release_created }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"trace-anything": "^1.0.1"
},
"scripts": {
"build": "npm install && gulp",
"build": "npm ci && gulp",
"test": "jasmine-browser-runner runSpecs"
}
}

0 comments on commit 6e4d133

Please sign in to comment.