Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: prepare for first release of new version #171

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
inputs:
title:
description: "Release title"
description: "Release title (blank for tag)"
required: false

jobs:
Expand All @@ -25,6 +25,7 @@ jobs:
with:
node-version: 20
cache: npm
registry-url: "https://registry.npmjs.org"

- name: Configure git
run: |
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -17,7 +20,9 @@
"cli",
"conventional commits"
],
"bin": "src/cli.js",
"bin": {
"version-bumper": "src/cli.js"
},
"main": "src/index.js",
"files": [
"!*",
Expand Down