Skip to content

Commit

Permalink
Prepare version 1.5.19 (#1502)
Browse files Browse the repository at this point in the history
* Prepare version 1.5.19

* move npm publish to GitHub Action
  • Loading branch information
campersau committed Jan 30, 2022
1 parent 64521bb commit e355698
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 115 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,13 @@ jobs:
name: ungit-win32-x64
path: dist/ungit-win32-x64.zip
retention-days: 7

- name: npm publish
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '12' && github.repository == 'FredrikNoren/ungit' && github.ref == 'refs/heads/master'
uses: actions/github-script@v5
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
script: |
const script = require('./scripts/npmpublish.js')
await script({github, context, core, exec})
76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).
We are following the [Keep a Changelog](https://keepachangelog.com/) format.

## [Unreleased](https://github.com/FredrikNoren/ungit/compare/v1.5.18...master)
## [Unreleased](https://github.com/FredrikNoren/ungit/compare/v1.5.19...master)

## [1.5.19](https://github.com/FredrikNoren/ungit/compare/v1.5.18...v1.5.19)

### Added
- Add Tab Size Configuration [#1499](https://github.com/FredrikNoren/ungit/pull/1499)
- Types: add support for VSCode IntelliSense [#1466](https://github.com/FredrikNoren/ungit/pull/1466)

### Changed
- Directory view [#1491](https://github.com/FredrikNoren/ungit/pull/1491)
- Node watch [#1465](https://github.com/FredrikNoren/ungit/pull/1465)
- Bump cached-path-relative from 1.0.2 to 1.1.0 [#1501](https://github.com/FredrikNoren/ungit/pull/1501)
- Bump Dependencies [#1483](https://github.com/FredrikNoren/ungit/pull/1483), [#1487](https://github.com/FredrikNoren/ungit/pull/1487), [#1492](https://github.com/FredrikNoren/ungit/pull/1492), [#1494](https://github.com/FredrikNoren/ungit/pull/1494)

## [1.5.18](https://github.com/FredrikNoren/ungit/compare/v1.5.17...v1.5.18)

Expand Down
5 changes: 2 additions & 3 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ungit",
"author": "Fredrik Norén <[email protected]>",
"description": "Git made easy",
"version": "1.5.18",
"version": "1.5.19",
"ungitPluginApiVersion": "0.2.0",
"scripts": {
"start": "node ./bin/ungit",
Expand All @@ -17,8 +17,7 @@
"watch": "nodemon -C --exec \"npm run build\" -e js,less -w public/source -w public/less -w components/ -i \"*.bundle.js\"",
"bumpdependencies": "ncu --upgrade --reject bootstrap",
"electronpackage": "node ./scripts/electronpackage.js",
"electronzip": "node ./scripts/electronzip.js",
"travisnpmpublish": "node ./scripts/travisnpmpublish.js"
"electronzip": "node ./scripts/electronzip.js"
},
"repository": {
"type": "git",
Expand Down
41 changes: 41 additions & 0 deletions scripts/npmpublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const fs = require('fs').promises;
const path = require('path');

module.exports = async ({ github, context, core, exec }) => {
core.info('Preparing npm publish');
const hash = context.sha.substring(0, 8);
const packageJson = JSON.parse(await fs.readFile('package.json'));
const version = packageJson.version;
const tag = `v${version}`;
packageJson.version += `+${hash}`;
await fs.writeFile('package.json', `${JSON.stringify(packageJson, null, 2)}\n`);
await fs.writeFile('.npmrc', '//registry.npmjs.org/:_authToken=' + process.env.NPM_TOKEN);
core.info(`Publish ${packageJson.version} to npm`);
if ((await exec.exec('npm publish')) != 0) {
core.info('npm publish failed.');
return;
}
core.info(`Creating release ${tag}`);
const release = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
name: tag,
tag_name: tag,
body: `[Changelog](https://github.com/FredrikNoren/ungit/blob/master/CHANGELOG.md#${version.replace(
/\./g,
''
)})`,
});
const filePaths = await fs.readdir('dist');
for (let i = 0; i < filePaths.length; i++) {
const filePath = path.join('dist', filePaths[i]);
core.info(`Uploading release asset ${filePath}`);
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.data.id,
name: path.basename(filePath).replace('ungit', `ungit-${version}`),
data: await fs.readFile(filePath),
});
}
};
32 changes: 0 additions & 32 deletions scripts/travisnpmpublish.js

This file was deleted.

0 comments on commit e355698

Please sign in to comment.