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

feat/CS-39611-changed node-version to 18 #37

Merged
merged 2 commits into from
Jul 13, 2023
Merged
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
86 changes: 48 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,60 @@
name: Releases

name: Release
on:
push:
branches: [main]

branches:
- [main]
jobs:
build:
name: Build and upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Checkout
uses: actions/[email protected]
with:
node-version: "16.x"
- run: npm install

- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: install npm packall
run: npm install npm-pack-all
fetch-depth: 0
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '18.x'
- name: Install dependencies
run: npm install
- name: Build
run: npm run prepack
- name: Upload dist
uses: actions/[email protected]
with:
name: lib
path: lib

- run: node node_modules/.bin/npm-pack-all
- uses: Klemensas/action-autotag@stable
id: update_tag
release:
name: Download dist and release
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/[email protected]
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
tag_prefix: "v"
- name: Create Release
if: steps.update_tag.outputs.tagname
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
fetch-depth: 0
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '18.x'
- name: Install dependencies
run: npm install
- name: Download dist
uses: actions/download-artifact@v3
with:
tag_name: ${{ steps.update_tag.outputs.tagname }}
release_name: Release ${{ steps.update_tag.outputs.tagname }}
draft: false # Default value, but nice to set explicitly
prerelease: false # Default value, but nice to set explicitly
- name: Upload Release Asset
if: steps.update_tag.outputs.tagname
id: upload-release-asset
uses: actions/upload-release-asset@v1
name: lib
path: lib
- name: Display dirs
run: ls -R
- name: Release
id: release-plugin
uses: JS-DevTools/[email protected]
with:
token: ${{ secrets.NPM_TOKEN }}
- name: github-release
id: github-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./contentstack-cli-cm-regex-validate-${{ steps.package-version.outputs.current-version }}.tgz
asset_name: contentstack-cli-cm-regex-validate-${{ steps.package-version.outputs.current-version }}.tgz
asset_content_type: application/tgz
run: gh release create v${{ steps.release-plugin.outputs.version }} --title "Release ${{ steps.release-plugin.outputs.version }}" --generate-notes
Loading