Skip to content

Commit

Permalink
Merge pull request #55 from ovh/dev/mjones/autorelease
Browse files Browse the repository at this point in the history
build: add release workflow
  • Loading branch information
marie-j authored Jul 29, 2024
2 parents a01b6d5 + 20aab3f commit f2f634a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
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

0 comments on commit f2f634a

Please sign in to comment.