From 94d1a57d98836469e8881ca7a36101f97e49efb5 Mon Sep 17 00:00:00 2001 From: Edwin Sirko Date: Wed, 24 Jan 2024 11:01:54 -0500 Subject: [PATCH] v0.0.62: created generate-new-version.sh --- action.yml | 4 +--- dist/index.js | 9 +-------- generate-new-version.sh | 25 +++++++++++++++++++++++++ src/main.ts | 10 +--------- 4 files changed, 28 insertions(+), 20 deletions(-) create mode 100755 generate-new-version.sh diff --git a/action.yml b/action.yml index a705482..dc17188 100644 --- a/action.yml +++ b/action.yml @@ -28,12 +28,10 @@ runs: shell: bash # - run: node ./dist/index.js # shell: bash - - uses: ddivad195/publish-action-package/package-and-publish@v0.0.61 + - uses: ddivad195/publish-action-package/package-and-publish@vv0.0.62 id: publish env: TOKEN: ${{ github.token }} - who_to_greet: ${{ inputs.registry }} - who_to_greet2: Monalisa - name: Output variables shell: bash run: | diff --git a/dist/index.js b/dist/index.js index 8e654ce..8b36099 100644 --- a/dist/index.js +++ b/dist/index.js @@ -74742,13 +74742,6 @@ const semver_1 = __importDefault(__nccwpck_require__(11383)); async function run() { const tmpDirs = []; try { - const whoToGreet = process.env.who_to_greet; - core.info(`Hello, ${whoToGreet}!`); - const token2 = process.env.TOKEN; - core.info(`Hello, ${token2}!`); - const token3 = process.env.who_to_greet2; - core.info(`whaaa? ${token3}!`); - core.info('Hello, world!'); // Parse and validate Actions execution context, including the repository name, release name and event type const repository = process.env.GITHUB_REPOSITORY || ''; if (repository === '') { @@ -74770,7 +74763,7 @@ async function run() { return; } // Gather & validate user inputs - const token = core.getInput('token'); + const token = process.env.TOKEN; console.log(`Official url: ${process.env.GITHUB_API_URL + '/packages/container-registry-url'}`); //const response = await fetch( // process.env.GITHUB_API_URL + '/packages/container-registry-url' diff --git a/generate-new-version.sh b/generate-new-version.sh new file mode 100755 index 0000000..3242ee8 --- /dev/null +++ b/generate-new-version.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +VERSION=$1 +MESSAGE=$2 + +if [ -z "$VERSION" ] +then + echo "No version supplied" + exit 1 +fi + +if [ -z "$MESSAGE" ] +then + echo "No message supplied" + exit 1 +fi + +echo "Generating new version $VERSION with message $MESSAGE" + +sed -i '' -E 's/ddivad195\/publish-action-package\/package-and-publish.*$/ddivad195\/publish-action-package\/package-and-publish@v'$VERSION'/g' action.yml +npm run bundle +git add . +git commit -m "$VERSION: $MESSAGE" +git push +gh release create --repo ddivad195/publish-action-package --title $VERSION --notes $VERSION $VERSION \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 799b2d0..550a75b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,14 +13,6 @@ export async function run(): Promise { const tmpDirs: string[] = [] try { - const whoToGreet = process.env.who_to_greet - core.info(`Hello, ${whoToGreet}!`) - const token2 = process.env.TOKEN - core.info(`Hello, ${token2}!`) - const token3 = process.env.who_to_greet2 - core.info(`whaaa? ${token3}!`) - core.info('Hello, world!') - // Parse and validate Actions execution context, including the repository name, release name and event type const repository: string = process.env.GITHUB_REPOSITORY || '' if (repository === '') { @@ -46,7 +38,7 @@ export async function run(): Promise { } // Gather & validate user inputs - const token: string = core.getInput('token') + const token: string = process.env.TOKEN! console.log( `Official url: ${