From 20aab3fbadb21469dbf3855e37e6ece45783eb3a Mon Sep 17 00:00:00 2001 From: Marie JONES <14836007+marie-j@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:54:03 +0200 Subject: [PATCH] build: add release workflow --- .github/workflows/release.yaml | 42 ++++++++++++++++++++++++++++++++++ package.json | 3 +++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..fd1281d --- /dev/null +++ b/.github/workflows/release.yaml @@ -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 "action@users.noreply.github.com" + 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 }} \ No newline at end of file diff --git a/package.json b/package.json index 8af6fcb..d4e97d9 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "REST", "api.ovh.com" ], + "files": [ + "lib" + ], "main": "./lib/ovh.es5.js", "repository": { "type": "git",