Skip to content

Commit

Permalink
release job
Browse files Browse the repository at this point in the history
  • Loading branch information
raon0211 committed May 31, 2024
1 parent b81df15 commit fc82183
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
cache: "yarn"
cache-dependency-path: "yarn.lock"
node-version-file: ".nvmrc"
- if: github.ref_type == 'branch'
run: |
jq \
--arg build "$GITHUB_RUN_NUMBER" \
--arg commit "${GITHUB_SHA::8}" \
'.version = .version + "-dev." + $build + "+" + $commit' \
package.json > package.json.tmp
mv package.json.tmp package.json
- run: yarn install
- run: 'mkdir -p out && yarn pack --out out/%s-%v.tgz'
- id: extract-changelog
uses: dahlia/submark@0.3.1
with:
input-file: CHANGELOG.md
heading-level: 2
heading-title-text: version ${{ github.ref_name }}
ignore-case: true
omit-heading: true
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: ${{ steps.extract-changelog.outputs.output-file }}
repository: toss/es-toolkit
generate_release_notes: false
token: ${{ secrets.TOSS_GITHUB_TOKEN }}
- if: |
github.event_name == 'push' &&
github.ref_type == 'tag' || github.ref == 'refs/heads/main'
run: |
set -ex
npm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN"
if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then
npm publish --provenance --access public *.tgz
else
npm publish --provenance --access public --tag dev *.tgz
fi
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: ${{ github.workspace }}/out/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ node_modules
coverage
dist
esm
.junit
.junit
out
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# es-toolkit Changelog

## Version 1.0.0

Initial release. Released on May 31th, 2024.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "es-toolkit",
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
"version": "0.0.1",
"version": "1.0.0",
"workspaces": [
"docs"
],
Expand Down

0 comments on commit fc82183

Please sign in to comment.