From c6cec8c885bd16d04bf1051a65ab7aeb0177e993 Mon Sep 17 00:00:00 2001 From: Jeroen de Bruijn <62570005+jdbruijn@users.noreply.github.com> Date: Mon, 11 May 2020 09:44:48 +0200 Subject: [PATCH] chore(release): release on separate branch with changelog (#73) * chore(release): release on separate branch with changelog * chore: update changelog * chore(ci): add required build step Co-authored-by: Michael Kriese --- .github/workflows/build.yml | 60 +++++++- .github/workflows/release.yml | 65 --------- .versionrc.js | 2 +- CHANGELOG.md | 44 +----- package-lock.json | 252 +++++++--------------------------- package.json | 16 +-- src/docker.ts | 3 +- src/get-version.ts | 5 + 8 files changed, 122 insertions(+), 325 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 src/get-version.ts diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b8fbf6a..1016eada 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,9 +64,65 @@ jobs: with: configurationFile: example/renovate-config.js token: ${{ secrets.RENOVATE_TOKEN }} - build: needs: [lint, commitlint, e2e] runs-on: ubuntu-latest steps: - - run: echo 'Dummy' + - run: echo 'dummy' + + release: + needs: [build] + runs-on: ubuntu-latest + if: | + startsWith(github.event.commits[0].message, + 'fix(deps): update renovate/renovate docker tag ') + && github.ref == 'refs/heads/master' + steps: + - name: Checkout + uses: actions/checkout@v2.1.0 + with: + fetch-depth: 0 + ref: 'release' + - name: Fetch tags + run: git fetch --tags + - name: Setup Git user + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Merge master + run: | + git merge -m 'chore(release): merge master (${{ github.sha }})' ${{ github.sha }} + - name: Setup node + uses: actions/setup-node@v1.4.1 + with: + node-version: '12.x' + - name: Install project + run: npm ci --ignore-scripts + - name: Get version + id: release + run: npm run release:version + - name: Release + run: npm run release -- "${{ steps.release.outputs.version }}" + - name: Get changelog section + id: changelog + run: | + changelog="$(git show --unified=0 CHANGELOG.md \ + | tail +12 \ + | sed -e 's/^\+//' \ + | sed -z 's/\n/%0A/g;s/\r/%0D/g')" + echo "::set-output name=changelog::${changelog}" + - name: Publish release + run: git push --follow-tags + - name: Publish GitHub release + uses: actions/create-release@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.release.outputs.version }} + release_name: v${{ steps.release.outputs.version }} + body: | + *See the the [changelog]( + https://github.com/${{ github.repository }}/blob/release/CHANGELOG.md + ) for changes in all releases.* + + ${{ steps.changelog.outputs.changelog }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index fbf0a59f..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Release -on: - push: - branches: - - master -jobs: - release: - runs-on: ubuntu-latest - if: | - startsWith(github.event.commits[0].message, 'fix(deps): update renovate/renovate docker tag ') - steps: - - name: Checkout - uses: actions/checkout@v2.1.0 - with: - fetch-depth: 0 - - name: Fetch tags - run: git fetch --tags - - name: Setup Git user - run: | - git config --local user.name "github-actions[bot]" - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - - name: Setup node - uses: actions/setup-node@v1.4.1 - with: - node-version: '12.x' - - name: Install project - run: npm ci - - name: Release - run: | - SEMVER_REGEX="v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)" - if [[ ! "${{ github.event.commits[0].message }}" =~ ${SEMVER_REGEX} ]]; then - echo Not a semver like version - aborting: ${1} - exit 1 - fi - NEXT_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}" - MAJOR_VERSION="${BASH_REMATCH[1]}" - echo "::set-env name=NEXT_VERSION::${NEXT_VERSION}" - echo "::set-env name=MAJOR_VERSION::${MAJOR_VERSION}" - npm version ${NEXT_VERSION} -m "chore(release): ${NEXT_VERSION}" - git tag "v${MAJOR_VERSION}" - - - name: Publish release - run: | - git push origin "v${NEXT_VERSION}" - git push -f origin "v${MAJOR_VERSION}" - - # - name: Publish GitHub release - # uses: actions/create-release@v1.0.1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # tag_name: v${{ env.NEXT_VERSION }} - # release_name: v${{ env.NEXT_VERSION }} - # body: | - # See the the [changelog]( - # https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md - # ) for the changes included in this release. - prevent_failed_status: - name: Prevent failed status when skipped - runs-on: ubuntu-latest - steps: - - name: Prevent failed status when skipped - run: | - echo "Run this job to prevent the workflow status from showing as" \ - "failed when all other jobs are skipped." diff --git a/.versionrc.js b/.versionrc.js index 5a9e1fe9..7f3bcab3 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -1,6 +1,6 @@ module.exports = { scripts: { prerelease: - 'if [ "$(git branch --show-current)" != "master" ]; then exit 1; fi', + 'if [ "$(git branch --show-current)" != "release" ]; then exit 1; fi', }, }; diff --git a/CHANGELOG.md b/CHANGELOG.md index de350c1c..3c5c0dcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,45 +1,3 @@ # Changelog -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -### [1.0.5](https://github.com/vidavidorra/github-action-renovate/compare/v1.0.4...v1.0.5) (2020-03-30) - -### Bug Fixes - -- **deps:** update renovate/renovate docker tag to v19.189.0 ([#11](https://github.com/vidavidorra/github-action-renovate/issues/11)) ([df74dfa](https://github.com/vidavidorra/github-action-renovate/commit/df74dfa0053acfbf2db3f782f5c042065b9807f5)) - -### [1.0.4](https://github.com/vidavidorra/github-action-renovate/compare/v1.0.3...v1.0.4) (2020-03-28) - -### Bug Fixes - -- **deps:** update renovate/renovate docker tag to v19.184.2 ([#10](https://github.com/vidavidorra/github-action-renovate/issues/10)) ([32ae3cb](https://github.com/vidavidorra/github-action-renovate/commit/32ae3cb974963fdc7987adee6de3ad402ca2361b)) - -### [1.0.3](https://github.com/vidavidorra/github-action-renovate/compare/v1.0.2...v1.0.3) (2020-03-27) - -### Bug Fixes - -- **deps:** update renovate/renovate docker tag to v19.181.0 ([#8](https://github.com/vidavidorra/github-action-renovate/issues/8)) ([9b29fd3](https://github.com/vidavidorra/github-action-renovate/commit/9b29fd34fe1d09431e3b7967c5c4c71f4b8e67d6)) -- **deps:** update renovate/renovate docker tag to v19.184.0 ([#9](https://github.com/vidavidorra/github-action-renovate/issues/9)) ([de6975e](https://github.com/vidavidorra/github-action-renovate/commit/de6975e31a6c1c301f86ea5d04dd3e8579e5d815)) - -### [1.0.2](https://github.com/vidavidorra/github-action-renovate/compare/v1.0.1...v1.0.2) (2020-03-22) - -### Bug Fixes - -- **deps:** update renovate/renovate docker tag to v19.176.3 ([9957aeb](https://github.com/vidavidorra/github-action-renovate/commit/9957aeba72b45e1fcc9a87b8532a52ad2464a526)) - -### [1.0.1](https://github.com/vidavidorra/github-action-renovate/compare/v1.0.0...v1.0.1) (2020-03-20) - -## 1.0.0 (2020-03-20) - -### Features - -- add self-hosted renovate sources ([5f5662b](https://github.com/vidavidorra/github-action-renovate/commit/5f5662bb8600d82e9e23ac911d56ec943ab3c0ff)) -- add token input and account for Renovate WORKDIR ([cd4dee3](https://github.com/vidavidorra/github-action-renovate/commit/cd4dee329720030349b278460f2f6ff8ddaca4c4)) - -### Bug Fixes - -- add chmod+x for entrypoint ([f0979c4](https://github.com/vidavidorra/github-action-renovate/commit/f0979c49826eb1885a487e12c30cea1650e7266b)) -- correct COPY in dockerfile for relative path ([341841e](https://github.com/vidavidorra/github-action-renovate/commit/341841ebc60c5c2a221ed49db2f91326bcd0cdd8)) -- prefix configuration file with GitHub workspace dir ([26124b0](https://github.com/vidavidorra/github-action-renovate/commit/26124b07e464ef56a31f3e77425052bb67ac8a20)) -- the Dockerfile MUST have a lowercase F for GitHub Action to work ([3e4d5f0](https://github.com/vidavidorra/github-action-renovate/commit/3e4d5f0dd6da60c4277b72bb0a26dd4dd2707dd7)) -- typo in action 9DockerFile) ([5525465](https://github.com/vidavidorra/github-action-renovate/commit/5525465215bf73411f8a5b436105a1fc8175e031)) +The changelog is only available on the `releases` branch. Please refer to [CHANGELOG.md](https://github.com/renovatebot/github-action/blob/releases/CHANGELOG.md) there. diff --git a/package-lock.json b/package-lock.json index e96e4c81..74213b65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -508,6 +508,12 @@ "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==", "dev": true }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -661,27 +667,6 @@ "supports-color": "^5.3.0" } }, - "chalk-cli": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk-cli/-/chalk-cli-4.1.0.tgz", - "integrity": "sha512-Nsi7JmzX6R8NnUHJGgbLw53je9PpMG3OHYPlyYTY4KcZNFCyOOXXCjd0EH99mwH8ZCnyAU573uWaOiPTT3gJpg==", - "dev": true, - "requires": { - "ansi-styles": "^3.1.0", - "chalk": "^2.0.0", - "dot-prop": "^3.0.0", - "get-stdin": "^6.0.0", - "meow": "^5.0.0" - }, - "dependencies": { - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true - } - } - }, "chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -1516,6 +1501,12 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -3111,6 +3102,12 @@ "signal-exit": "^3.0.0" } }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "map-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", @@ -3234,190 +3231,6 @@ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, - "next-standard-version": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/next-standard-version/-/next-standard-version-2.1.3.tgz", - "integrity": "sha512-GtsXSlALcteq65eMRhE9vm/hQWE2tXDobLBVmfBzxn8Bj327gHn5F4aDs0gYHiqS6fu1/WhIRNEsxe+FBiPBEQ==", - "dev": true, - "requires": { - "semver": "7.3.2", - "standard-version": "8.0.0", - "strip-ansi": "6.0.0", - "yargs": "15.3.1" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "conventional-changelog": { - "version": "3.1.18", - "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.18.tgz", - "integrity": "sha512-aN6a3rjgV8qwAJj3sC/Lme2kvswWO7fFSGQc32gREcwIOsaiqBaO6f2p0NomFaPDnTqZ+mMZFLL3hlzvEnZ0mQ==", - "dev": true, - "requires": { - "conventional-changelog-angular": "^5.0.6", - "conventional-changelog-atom": "^2.0.3", - "conventional-changelog-codemirror": "^2.0.3", - "conventional-changelog-conventionalcommits": "^4.2.3", - "conventional-changelog-core": "^4.1.4", - "conventional-changelog-ember": "^2.0.4", - "conventional-changelog-eslint": "^3.0.4", - "conventional-changelog-express": "^2.0.1", - "conventional-changelog-jquery": "^3.0.6", - "conventional-changelog-jshint": "^2.0.3", - "conventional-changelog-preset-loader": "^2.3.0" - } - }, - "conventional-changelog-angular": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.6.tgz", - "integrity": "sha512-QDEmLa+7qdhVIv8sFZfVxU1VSyVvnXPsxq8Vam49mKUcO1Z8VTLEJk9uI21uiJUsnmm0I4Hrsdc9TgkOQo9WSA==", - "dev": true, - "requires": { - "compare-func": "^1.3.1", - "q": "^1.5.1" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true - }, - "standard-version": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-8.0.0.tgz", - "integrity": "sha512-cS/U9yhYPHfyokFce6e/H3U8MaKwZKSGzH25J776sChrae/doDQjsl3vCQ0hW1MSzdrUTb7pir4ApjnbDt/TAg==", - "dev": true, - "requires": { - "chalk": "2.4.2", - "conventional-changelog": "3.1.18", - "conventional-changelog-config-spec": "2.1.0", - "conventional-changelog-conventionalcommits": "4.2.3", - "conventional-recommended-bump": "6.0.5", - "detect-indent": "6.0.0", - "detect-newline": "3.1.0", - "dotgitignore": "2.1.0", - "figures": "3.1.0", - "find-up": "4.1.0", - "fs-access": "1.0.1", - "git-semver-tags": "3.0.1", - "semver": "7.1.1", - "stringify-package": "1.0.1", - "yargs": "15.3.1" - }, - "dependencies": { - "semver": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.1.tgz", - "integrity": "sha512-WfuG+fl6eh3eZ2qAf6goB7nhiCd7NPXhmyFxigB/TOkQyeLP8w8GsVehvtGNtnNmyboz4TgeK40B1Kbql/8c5A==", - "dev": true - } - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "yargs": { - "version": "15.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", - "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.1" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -4077,6 +3890,16 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "spawn-command": { "version": "0.0.2-1", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", @@ -4476,6 +4299,19 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, + "ts-node": { + "version": "8.10.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.1.tgz", + "integrity": "sha512-bdNz1L4ekHiJul6SHtZWs1ujEKERJnHs4HxN7rjTyyVOFf3HaJ6sLqe6aPG62XTzAB/63pKRh5jTSWL0D7bsvw==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } + }, "tslib": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", @@ -4878,6 +4714,12 @@ "requires": { "camelcase": "^4.1.0" } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true } } } diff --git a/package.json b/package.json index 13713a5c..fe763194 100644 --- a/package.json +++ b/package.json @@ -3,21 +3,22 @@ "version": "0.0.0-PLACEHOLDER", "description": "GitHub Action to run Renovate self-hosted.", "private": true, - "main": "dist/index.js", + "main": "src/index.ts", "scripts": { - "build:dist": "cd src && ncc build ./index.ts -o ../dist", - "build": "cd src && ncc build ./index.ts -o ../dist", "format": "prettier --write \"**/*.{js,jsx,vue,ts,css,less,scss,html,htm,json,md,markdown,yml,yaml}\"", "format:file": "prettier --write", - "git:dist": "git add -f dist", "lint": "concurrently npm:lint-es", "lint:fix": "concurrently npm:lint-es:fix", "lint-es": "eslint --ext .ts,.tsx,.js,.jsx,.json .", "lint-es:file": "eslint --ext .ts,.tsx,.js,.jsx,.json", "lint-es:fix": "eslint --ext .ts,.tsx,.js,.jsx,.json --fix .", "lint-es:file:fix": "eslint --ext .ts,.tsx,.js,.jsx,.json --fix", - "start": "run-s build:dist && node dist", - "version": "run-s build:* git:*" + "release:version": "node_modules/.bin/ts-node src/get-release-version", + "release:commit": "git add --force dist", + "release:standard-version": "standard-version --release-as", + "release": "run-s build release:commit \"release:standard-version -- {1}\" --", + "build": "ncc build -o dist", + "start": "run-s build && node dist" }, "repository": { "type": "git", @@ -40,7 +41,6 @@ "@typescript-eslint/eslint-plugin": "2.31.0", "@typescript-eslint/parser": "2.31.0", "@zeit/ncc": "0.22.1", - "chalk-cli": "4.1.0", "concurrently": "5.2.0", "eslint": "6.8.0", "eslint-config-prettier": "6.11.0", @@ -48,10 +48,10 @@ "eslint-plugin-prettier": "3.1.3", "husky": "4.2.5", "lint-staged": "10.2.2", - "next-standard-version": "2.1.3", "npm-run-all": "4.1.5", "prettier": "2.0.5", "standard-version": "7.1.0", + "ts-node": "8.10.1", "typescript": "3.8.3" } } diff --git a/src/docker.ts b/src/docker.ts index c814a6fe..5e2e11db 100644 --- a/src/docker.ts +++ b/src/docker.ts @@ -2,13 +2,14 @@ class Docker { readonly repository = 'renovate/renovate'; // renovate: datasource=docker depName=renovate/renovate versioning=docker readonly tag = '19.234.1-slim'; + readonly tagSuffix = '-slim'; image(): string { return `${this.repository}:${this.tag}`; } version(): string { - return this.tag; + return this.tag.replace(this.tagSuffix, ''); } } diff --git a/src/get-version.ts b/src/get-version.ts new file mode 100644 index 00000000..7cbd86a5 --- /dev/null +++ b/src/get-version.ts @@ -0,0 +1,5 @@ +import * as core from '@actions/core'; +import Docker from './docker'; + +const docker = new Docker(); +core.setOutput('version', docker.version());