1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-08 17:41:12 +02:00
Files
gitea-release-please-action/.github/workflows/release-please.yaml
Jeff Ching b1da2aee9f build: remove unneeded, failing labelling step (#890)
release-please already adds the `autorelease:pending` label

It has been failing for quite awhile with:
```
SyntaxError: missing ) after argument list
    at new AsyncFunction (<anonymous>)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:7514:16)
Error: Unhandled error: SyntaxError: missing ) after argument list
    at main (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:7541:26)
    at Module.720 (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:7525:1)
    at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:24:31)
    at startup (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:43:[19](https://github.com/google-github-actions/release-please-action/actions/runs/7064411294/job/19232404141#step:3:20))
    at /home/runner/work/_actions/actions/github-script/v3/dist/index.js:49:18
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:52:10)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1[25](https://github.com/google-github-actions/release-please-action/actions/runs/7064411294/job/19232404141#step:3:26)2:10)
```
2023-12-01 12:02:30 -08:00

100 lines
3.8 KiB
YAML

on:
push:
branches:
- main
workflow_dispatch:
name: release-please
env:
ACTION_NAME: release-please-action
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 20
- name: install
run: npm ci
- name: build
run: npm run build
- name: commit
run: |-
set -e
# get current commit hash
CURRENT_HASH=$(git rev-parse HEAD)
# get last commit hash of last build dist
LAST_BUILD_HASH=$(git log --author=google-github-actions-bot -1 --pretty=format:"%H")
DIFF=""
# build and commit dist if diff
git config --global user.name "actions-bot"
git config user.email 'github-actions-bot@google.com'
git add dist/
git diff-index --quiet HEAD || git commit -m "chore: build dist ${ACTION_NAME}"
# if last commit hash of last build dist was found, get logs of commits in btw for PR body
if [ -z "$LAST_BUILD_HASH" ]
then
echo "Unable to find last commit by bot, skipping diff gen"
else
DIFF=$(git log ${LAST_BUILD_HASH}...${CURRENT_HASH} --oneline)
echo $DIFF
fi
# set env vars
echo "CURRENT_HASH=${CURRENT_HASH}" >> $GITHUB_ENV
echo "LAST_BUILD_HASH=${LAST_BUILD_HASH}" >> $GITHUB_ENV
echo 'DIFF<<EOF' >> $GITHUB_ENV
echo "${DIFF}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Create PR with dist
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
commit-message: Build dist
author: "actions-bot <github-actions-bot@google.com>"
title: "chore: build dist"
body: |
Build dist PR
${{env.DIFF}}
labels: automated pr
branch: create-pull-request/build-dist
delete-branch: true
push-to-fork: google-github-actions-bot/${{env.ACTION_NAME}}
release-please-release:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: google-github-actions/release-please-action@main
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
skip-github-pull-request: true
- uses: actions/checkout@v2
- name: tag major and patch versions
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN}}@github.com/google-github-actions/release-please-action.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
if: ${{ steps.release.outputs.release_created }}
release-please-pr:
runs-on: ubuntu-latest
needs:
- build
- release-please-release
steps:
- id: release-pr
uses: google-github-actions/release-please-action@main
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
release-type: node
fork: true
skip-github-release: true