Skip to content

Commit

Permalink
Patch release process
Browse files Browse the repository at this point in the history
  • Loading branch information
ifconfigla committed Aug 14, 2023
1 parent a9fd900 commit 8ab5753
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -14,12 +14,14 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm i -g @ifconfigla/nzip
- run: npm i
- run: npm run dist
- run: npm publish
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -29,5 +31,3 @@ jobs:
# note you'll typically need to create a personal access token
# with permissions to create releases in the other repo
token: ${{ secrets.GH_TOKEN }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 1 addition & 2 deletions scripts/pack.sh
Expand Up @@ -8,7 +8,7 @@ PUB_KEY="ifconfig-dev.asc"
nzip -p && mv ${PACKAGE_NAME}.zip dist/${PACKAGE_NAME}-${PACKAGE_VERSION}-src.zip
cp ${PUB_KEY} dist
cd dist
rm SHA256SUMS.asc
rm SHA256SUMS SHA256SUMS.asc
chmod +x ${PACKAGE_NAME}-linux
chmod +x ${PACKAGE_NAME}-macos
mv ${PACKAGE_NAME}-linux ${PACKAGE_NAME} && tar -czvf ${PACKAGE_NAME}-${PACKAGE_VERSION}-x86_64-linux.tar.gz ${PACKAGE_NAME} && rm ${PACKAGE_NAME}
Expand All @@ -18,7 +18,6 @@ sha256sum * > SHA256SUMS

if [[ ! -v GITHUB_ACTIONS ]]; then
gpg --clear-sign SHA256SUMS
rm SHA256SUMS
cd -;
zip -r ${PACKAGE_NAME}-${PACKAGE_VERSION}-dist.zip dist
else
Expand Down
8 changes: 8 additions & 0 deletions scripts/release-note.js
Expand Up @@ -7,6 +7,8 @@ const pubKey = process.argv[2];

const githubUrl = github ?? homepage.replace('https://github.com/', '');

const digest = fs.readFileSync('./dist/SHA256SUMS', { encoding: 'utf8' });

const releaseNoteString = `
![GitHub Release)](https://img.shields.io/github/downloads/${githubUrl}/v${version}/total?color=blue&style=flat-square)
Expand All @@ -27,6 +29,12 @@ Check with the following command
${name} --help
\`\`\`
### SHA256SUMS
\`\`\`
${digest}
\`\`\`
### How to verify
First, import our PGP key used for release process if you haven't
Expand Down

0 comments on commit 8ab5753

Please sign in to comment.