From 72a2f46d3dda05a3c9f106106c8468eaaccdb926 Mon Sep 17 00:00:00 2001 From: "Chase, Justin M" Date: Thu, 1 Aug 2024 18:26:31 -0500 Subject: [PATCH 1/7] add an action --- .github/version.yml | 3 +++ .github/workflows/checks.yml | 14 ++++++++++---- action.yml | 20 ++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 action.yml diff --git a/.github/version.yml b/.github/version.yml index 33f2b70..4ef23f4 100644 --- a/.github/version.yml +++ b/.github/version.yml @@ -9,3 +9,6 @@ on: - kind: regexp file: Dockerfile pattern: '(?<=VERSION=).*(?=; \\)' + - kind: regexp + file: action.yml + pattern: '(?<=default: ).*' diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 24c215a..637092e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -21,7 +21,7 @@ jobs: - run: deno fmt --check - run: deno lint - run: deno task test - + - id: parse_version name: Parse the Version run: deno run -A main.ts parse @@ -29,13 +29,13 @@ jobs: - name: Print the Version run: | cat >> $GITHUB_STEP_SUMMARY< Date: Thu, 1 Aug 2024 18:35:27 -0500 Subject: [PATCH 2/7] /setup --- .github/workflows/checks.yml | 2 +- action.yml => setup/action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename action.yml => setup/action.yml (95%) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 637092e..7cc72a8 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -49,5 +49,5 @@ jobs: action: runs-on: [ ubuntu-latest ] steps: - - uses: ./ + - uses: ./setup - run: semver -v diff --git a/action.yml b/setup/action.yml similarity index 95% rename from action.yml rename to setup/action.yml index ea55ab0..bfca163 100644 --- a/action.yml +++ b/setup/action.yml @@ -1,4 +1,4 @@ -name: semver-cli +name: semver-cli-setup description: Optum Semver CLI branding: icon: activity From 4e1e796f9c0b2472e4ecd78b0c38c57c587a949e Mon Sep 17 00:00:00 2001 From: "Chase, Justin M" Date: Thu, 1 Aug 2024 18:36:42 -0500 Subject: [PATCH 3/7] checkout --- .github/workflows/checks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7cc72a8..17422e1 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -12,7 +12,7 @@ jobs: runs-on: [ ubuntu-latest ] steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 with: deno-version: v1.x @@ -49,5 +49,6 @@ jobs: action: runs-on: [ ubuntu-latest ] steps: + - uses: actions/checkout@v4 - uses: ./setup - run: semver -v From 010b99cdd1425a88f0b2e04d38e5f90138ef2ced Mon Sep 17 00:00:00 2001 From: "Chase, Justin M" Date: Thu, 1 Aug 2024 18:38:30 -0500 Subject: [PATCH 4/7] provide github token --- setup/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup/action.yml b/setup/action.yml index bfca163..41aa95c 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -7,6 +7,9 @@ inputs: version: description: Version default: 0.8.11 + token: + description: GitHub Token + required: false runs: using: "composite" @@ -18,3 +21,5 @@ runs: DIR=$HOME/.semver-cli/.bin gh release --repo https://github.com/optum/semver-cli download $VERSION -p semver.x86_64-unknown-linux-gnu.tar.gz --dir $DIR --clobber tar -xzf DIR/semver.x86_64-unknown-linux-gnu.tar.gz -C $DIR + env: + GH_TOKEN: ${{ inputs.token || github.token }} From 6235520605cda8635ff3e039316ccf8edc453330 Mon Sep 17 00:00:00 2001 From: "Chase, Justin M" Date: Thu, 1 Aug 2024 18:41:11 -0500 Subject: [PATCH 5/7] $dir --- setup/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/action.yml b/setup/action.yml index 41aa95c..9f9dae5 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -19,7 +19,9 @@ runs: run: | VERSION='${{ inputs.version}}' DIR=$HOME/.semver-cli/.bin + mkdir -p $DIR + gh release --repo https://github.com/optum/semver-cli download $VERSION -p semver.x86_64-unknown-linux-gnu.tar.gz --dir $DIR --clobber - tar -xzf DIR/semver.x86_64-unknown-linux-gnu.tar.gz -C $DIR + tar -xzf $DIR/semver.x86_64-unknown-linux-gnu.tar.gz -C $DIR env: GH_TOKEN: ${{ inputs.token || github.token }} From d9265acd4411421a6aa29b0fbeb237b15b5cb9a5 Mon Sep 17 00:00:00 2001 From: "Chase, Justin M" Date: Thu, 1 Aug 2024 18:42:10 -0500 Subject: [PATCH 6/7] export path --- setup/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/action.yml b/setup/action.yml index 9f9dae5..7e63ebb 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -23,5 +23,7 @@ runs: gh release --repo https://github.com/optum/semver-cli download $VERSION -p semver.x86_64-unknown-linux-gnu.tar.gz --dir $DIR --clobber tar -xzf $DIR/semver.x86_64-unknown-linux-gnu.tar.gz -C $DIR + + echo "$DIR" >> $GITHUB_PATH env: GH_TOKEN: ${{ inputs.token || github.token }} From 38cbfeed318842ab120ef8228b51ce1650337684 Mon Sep 17 00:00:00 2001 From: "Chase, Justin M" Date: Thu, 1 Aug 2024 18:43:21 -0500 Subject: [PATCH 7/7] get the current version --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 17422e1..d4c5d0f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -51,4 +51,4 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./setup - - run: semver -v + - run: semver get