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

Release #4

Merged
merged 31 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5fb0b14
feat(package-name): change package name to publish
jamesbuddrige Mar 6, 2024
85636af
chore(release): 1.0.0-prerelease.3 [skip ci]
semantic-release-bot Mar 6, 2024
7c66fff
fix: use correct release builder
jamesbuddrige Mar 6, 2024
31f7f81
Merge branch 'main' of https://github.com/jamesbuddrige/semantic-rele…
jamesbuddrige Mar 6, 2024
ee86533
chore(release): 1.0.0-prerelease.4 [skip ci]
semantic-release-bot Mar 6, 2024
0a92dfb
feat: change package name to personal namespace
jamesbuddrige Mar 6, 2024
6ee7306
feat: change package name
jamesbuddrige Mar 6, 2024
93716e9
chore(release): 1.0.0-prerelease.5 [skip ci]
semantic-release-bot Mar 6, 2024
cc5dcab
fix(release): make package public
jamesbuddrige Mar 6, 2024
54b3a25
Merge branch 'main' of https://github.com/jamesbuddrige/semantic-rele…
jamesbuddrige Mar 6, 2024
bf0ee73
chore(release): 1.0.0-prerelease.6 [skip ci]
semantic-release-bot Mar 6, 2024
2fb9a27
docs(readme): update README links to point to the new, maintained pac…
jamesbuddrige Mar 6, 2024
b27d973
Merge branch 'main' of https://github.com/jamesbuddrige/semantic-rele…
jamesbuddrige Mar 6, 2024
f43a5ff
chore(lint): add linting with eslint
jamesbuddrige Mar 7, 2024
3da426b
fix(docs): use correct documentation (needs fix for release)
jamesbuddrige Mar 7, 2024
ba0bb4e
chore(release): 1.0.0-prerelease.7 [skip ci]
semantic-release-bot Mar 7, 2024
4dbae46
ci(scripts): update scripts for linting and remove unused
jamesbuddrige Mar 7, 2024
70c9620
Merge branch 'main' of https://github.com/jamesbuddrige/semantic-rele…
jamesbuddrige Mar 7, 2024
4542bce
fix(readme.md): fix incorrect plugin documentation
jamesbuddrige Mar 7, 2024
5084d72
chore(release): 1.0.0-prerelease.8 [skip ci]
semantic-release-bot Mar 7, 2024
8c3e780
feat: add Jira Auth as env for semrel
jamesbuddrige Mar 7, 2024
a70d1f2
Merge branch 'main' of https://github.com/jamesbuddrige/semantic-rele…
jamesbuddrige Mar 8, 2024
87efa94
chore(release): 1.0.0-prerelease.9 [skip ci]
semantic-release-bot Mar 8, 2024
2f8cbb1
fix(description): re-word release description
jamesbuddrige Mar 8, 2024
c68de8d
chore(release): 1.0.0-prerelease.10 [skip ci]
semantic-release-bot Mar 8, 2024
98f5031
feat(jtp-1): only run release for full releases
jamesbuddrige Mar 8, 2024
0939dfc
Merge branch 'main' of https://github.com/jamesbuddrige/semantic-rele…
jamesbuddrige Mar 8, 2024
aaf4950
chore(release): 1.0.0-prerelease.11 [skip ci]
semantic-release-bot Mar 8, 2024
4ecfc56
fix(release-requirement): only run releases on main distribution, not…
jamesbuddrige Mar 8, 2024
4faa302
chore(release): 1.0.0-prerelease.12 [skip ci]
semantic-release-bot Mar 8, 2024
fb51c00
Merge branch 'prod' into main
jamesbuddrige Mar 8, 2024
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
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
"env": {
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
extra_plugins: |
@saithodev/semantic-release-backmerge
@semantic-release/git
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
JIRA_AUTH: ${{ secrets.JIRA_AUTH }}
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to publish a jira release.

[![Travis](https://img.shields.io/travis/UpHabit/semantic-release-jira-releases.svg)](https://travis-ci.org/UpHabit/semantic-release-jira-releases)

[![npm latest version](https://img.shields.io/npm/v/semantic-release-jira-releases/latest.svg)](https://www.npmjs.com/package/semantic-release-jira-releases)
[![npm latest version](https://img.shields.io/npm/v/@jamesbuddrige/semantic-release-jira/latest.svg)](https://www.npmjs.com/package/@jamesbuddrige/semantic-release-jira)


| Step | Description |
Expand All @@ -15,8 +13,8 @@
## Install

```bash
$ npm install --save-dev semantic-release-jira-releases
$ yarn add --dev semantic-release-jira-releases
$ npm install --save-dev @jamesbuddrige/semantic-release-jira
$ yarn add --dev @jamesbuddrige/semantic-release-jira
```

### Configuration
Expand All @@ -27,10 +25,10 @@ The plugin should be added to your config
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/git",
["semantic-release-jira-releases", {
"projectId": "UH",
["@jamesbuddrige/semantic-release-jira", {
"projectId": "ABC",
"releaseNameTemplate": "Test v${version}",
"jiraHost": "uphabit.atlassian.net",
"jiraHost": "https://jira-domain.atlassian.net",
"ticketPrefixes": [ "TEST", "UH"],
"ticketRegex": "[a-zA-Z]{3,5}-\\d{3,5}"
}]
Expand Down
8 changes: 8 additions & 0 deletions lib/success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
newVersion = {
name,
id: 'dry_run_id',
} as any;

Check failure on line 51 in lib/success.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected any. Specify a different type
} else {
const descriptionText = description || '';
newVersion = await jira.projectVersions.createVersion({
name,
projectId: projectIdOrKey as any,

Check failure on line 56 in lib/success.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected any. Specify a different type
description: descriptionText,
released: Boolean(config.released),
releaseDate: config.setReleaseDate ? (new Date().toISOString()) : undefined,
Expand All @@ -75,7 +75,7 @@
add: { id: releaseVersionId },
}],
},
properties: undefined as any,

Check failure on line 78 in lib/success.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected any. Specify a different type
});
}
} catch (exception: any) {
Expand All @@ -91,6 +91,14 @@
}

export async function success(config: PluginConfig, context: GenerateNotesContext): Promise<void> {
// Confirm it's a not a pre-release (undefined), otherwise we don't want to create a release in Jira
if (context.nextRelease.channel !== undefined) {
context.logger.info(`Skipping release creation for pre-release`);
return;
} else {
context.logger.info(`Creating release for main channel: ${context.nextRelease.version}`);
}

const tickets = getTickets(config, context);

context.logger.info(`Found ticket ${tickets.join(', ')}`);
Expand Down
1 change: 1 addition & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface PreviousRelease {
export interface UpcomingRelease extends PreviousRelease {
notes: string;
type: string;
channel: string;
}

export interface GenerateNotesContext extends PluginContext {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"name": "semantic-release-jira-releases",
"version": "1.0.0",
"name": "@jamesbuddrige/semantic-release-jira",
"version": "1.0.0-prerelease.12",
"main": "dist/lib/index.js",
"repository": "https://github.com/jamesbuddrige/semantic-release-jira",
"license": "MIT",
"private": false,
"publishConfig": {
"access": "public"
},
"scripts": {
"prepublishOnly": "mkdir -p dist && rm -rf dist && tsc -p .",
"lint": "tslint -p .",
"lint": "eslint . --ext .ts",
"build": "tsc -p .",
"test": " jest"
},
Expand Down
Loading