From 88ed268e31449d9ca5c3e7a1ea0a4814cb09210a Mon Sep 17 00:00:00 2001 From: Tomer Figenblat Date: Thu, 8 Feb 2024 18:53:14 -0500 Subject: [PATCH] ci: prepare for first release of new version Signed-off-by: Tomer Figenblat --- .github/workflows/release.yml | 24 +++++++++++------------- package.json | 9 +++++++-- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5281b83..8b6d55f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: inputs: title: - description: "Release title" + description: "Release title (blank for tag)" required: false jobs: @@ -25,6 +25,7 @@ jobs: with: node-version: 20 cache: npm + registry-url: "https://registry.npmjs.org" - name: Configure git run: | @@ -50,7 +51,7 @@ jobs: - name: Decide new version id: bump - run: echo "version=$(node src/cli.js | jq '.next')" >> "$GITHUB_OUTPUT" + run: echo "version=$(node src/cli.js | jq '.next' | tr -d '"')" >> "$GITHUB_OUTPUT" - name: Update package version run: npm version ${{ steps.bump.outputs.version }} --no-git-tag-version @@ -61,17 +62,6 @@ jobs: git commit -m "build: updated package with ${{ steps.bump.outputs.version }} [skip ci]" git push - - name: Push new tag - run: | - git tag ${{ steps.bump.outputs.version }} -m "${{ steps.bump.outputs.version }}" - git push origin ${{ steps.bump.outputs.version }} - - - name: Extract meta for image - id: meta - uses: docker/metadata-action@v5 - with: - images: tomerfi/version-bumper - - name: Set a release name id: release_name uses: actions/github-script@v7 @@ -100,6 +90,14 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: npm publish + - name: Extract meta for image + id: meta + uses: docker/metadata-action@v5 + with: + images: tomerfi/version-bumper + labels: | + org.opencontainers.image.version=${{ steps.bump.outputs.version }} + - name: Push image uses: docker/build-push-action@v5 with: diff --git a/package.json b/package.json index 861abf1..3bea55f 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,10 @@ "name": "Tomer Figenblat", "url": "https://github.com/TomerFi" }, - "repository": "github:TomerFi/version-bumper", + "repository": { + "type": "git", + "url": "git+https://github.com/TomerFi/version-bumper.git" + }, "bugs": "https://github.com/TomerFi/version-bumper/issues", "keywords": [ "semver", @@ -17,7 +20,9 @@ "cli", "conventional commits" ], - "bin": "src/cli.js", + "bin": { + "version-bumper": "src/cli.js" + }, "main": "src/index.js", "files": [ "!*",