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

build: add release workflow #55

Merged
merged 1 commit into from
Jul 29, 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
42 changes: 42 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Restore/create node_modules cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install
run: npm install
- name: Tag
run: |
git config user.name "GitHub action"
git config user.email "[email protected]"
npm run release
git push --follow-tags origin master
- name: version
run: echo "::set-output name=version::$(node -e "console.log(require('./package.json').version);")"
id: version
- name: release
uses: actions/create-release@v1
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"REST",
"api.ovh.com"
],
"files": [
"lib"
],
"main": "./lib/ovh.es5.js",
"repository": {
"type": "git",
Expand Down