From 73bebf9ef43fa621ac44eb8e540bd23588b02fae Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 24 Jul 2022 02:05:16 +0200 Subject: [PATCH] Use GitHub builtin readme generator (.github/release.yaml) --- .github/workflows/ci.yaml | 34 ++++++++++------------------------ README.md | 6 ------ 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d3f9e4c..944d915 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -73,33 +73,19 @@ jobs: action_name: is_package_json_version_upgraded branch: ${{ github.head_ref || github.ref }} - update_changelog: - runs-on: ubuntu-latest - needs: check_if_version_upgraded - if: needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' - steps: - - uses: garronej/ts-ci@v1.1.4 - with: - action_name: update_changelog - branch: ${{ github.head_ref || github.ref }} - create_github_release: runs-on: ubuntu-latest + # We create a release only if the version have been upgraded and we are on a default branch + # PR on the default branch can release beta but not real release + if: | + needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' && + ( + github.event_name == 'push' || + needs.check_if_version_upgraded.outputs.is_release_beta == 'true' + ) needs: - - update_changelog - check_if_version_upgraded steps: - - name: Build GitHub release body - id: step1 - run: | - if [ "$FROM_VERSION" = "0.0.0" ]; then - echo "::set-output name=body::🚀" - else - echo "::set-output name=body::📋 [CHANGELOG](https://github.com/$GITHUB_REPOSITORY/blob/v$TO_VERSION/CHANGELOG.md)" - fi - env: - FROM_VERSION: ${{ needs.check_if_version_upgraded.outputs.from_version }} - TO_VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }} - uses: softprops/action-gh-release@v1 with: name: Release v${{ needs.check_if_version_upgraded.outputs.to_version }} @@ -114,7 +100,7 @@ jobs: publish_on_npm: runs-on: ubuntu-latest needs: - - update_changelog + - create_github_release - check_if_version_upgraded steps: - uses: actions/checkout@v2.3.4 @@ -152,4 +138,4 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }} - IS_BETA: ${{ needs.check_if_version_upgraded.outputs.is_release_beta }} + IS_BETA: ${{ needs.check_if_version_upgraded.outputs.is_release_beta }} \ No newline at end of file diff --git a/README.md b/README.md index 4fea7b6..cf6b169 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ https://user-images.githubusercontent.com/6702424/167035748-4fe28710-ed0f-4feb-a This template automates the boring and tedious tasks of: - Filling up the ``package.json`` - Setting up Typescript. -- Writing a [README.md](https://github.com/garronej/ts_ci/blob/main/README.template.md) with decent presentation and instructions on how to install/import your module. - Testing on multiple Node version running on Ubuntu and Windows before publishing. - Maintaining a CHANGELOG. - Publishing on NPM and creating corresponding GitHub releases. @@ -72,11 +71,6 @@ You can increase the verbosity by creating a new secret `ACTIONS_STEP_DEBUG` and ![image](https://user-images.githubusercontent.com/6702424/144307837-f401c595-4695-45e3-8459-b1c1ca7fabb9.png) -## How to put my own image in the ``README.md`` - -A good way to host your repo image is to open an issue named ASSET in your project, close it, create a comment, drag and drop the picture you want to use and that's it. You have a link that you can replace in the ``README.md``. -While you are at it submit this image as *social preview* in your repos github page's settings so that when you share on -Twitter or Reddit you don't get your GitHub profile picture to show up. ## Disable linting and formatting Remove [this](https://github.com/garronej/ts_ci/blob/974054f2b83f8170317f2b2fa60b5f78e9336c0b/package.json#L15-L18), [this](https://github.com/garronej/ts_ci/blob/974054f2b83f8170317f2b2fa60b5f78e9336c0b/package.json#L20-L32) and [this](https://github.com/garronej/ts_ci/blob/974054f2b83f8170317f2b2fa60b5f78e9336c0b/package.json#L47-L53) from your `package.json`