mirror of
https://github.com/fluencelabs/aqua-lib
synced 2025-04-25 16:02:17 +00:00
Add gitlab pipeline
This commit is contained in:
parent
c36daf905e
commit
3a13967173
70
.github/workflows/release.yml
vendored
Normal file
70
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
name: "publish-release"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
npm-publish:
|
||||||
|
name: "Publish"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
### Calculate FINAL_VERSION
|
||||||
|
- name: Install jq
|
||||||
|
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq
|
||||||
|
|
||||||
|
- name: Get version from npm and increment
|
||||||
|
run: |
|
||||||
|
yarn global add semver
|
||||||
|
PATH="$(yarn global bin):$PATH"
|
||||||
|
|
||||||
|
# take npm version and increment it
|
||||||
|
PKG_NAME="$(cat package.json | jq -r .name)"
|
||||||
|
NPM_VERSION="$(yarn info --silent "$PKG_NAME" version || true)"
|
||||||
|
NEXT_NPM_VERSION="$(semver --increment patch "$NPM_VERSION")"
|
||||||
|
|
||||||
|
# take local version
|
||||||
|
LOCAL_VERSION="$(cat package.json | jq -r .version)"
|
||||||
|
|
||||||
|
# take maximum of the local and NEXT_NPM versions
|
||||||
|
MAX_VERSION="$(semver "$LOCAL_VERSION" "$NEXT_NPM_VERSION" "0.0.0" | tail -n1)"
|
||||||
|
|
||||||
|
# save info to env
|
||||||
|
echo "FINAL_VERSION=$MAX_VERSION" | tee -a $GITHUB_ENV
|
||||||
|
echo "PKG_NAME=$PKG_NAME" | tee -a $GITHUB_ENV
|
||||||
|
|
||||||
|
### Set version
|
||||||
|
- name: Set version to ${{ env.FINAL_VERSION }}
|
||||||
|
run: yarn version --new-version ${{ env.FINAL_VERSION }} --no-git-tag-version
|
||||||
|
|
||||||
|
### Publish to NPM registry
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "14"
|
||||||
|
registry-url: "https://registry.npmjs.org"
|
||||||
|
|
||||||
|
- run: npm publish --access public
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
|
### Create a release
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.FINAL_VERSION }}
|
||||||
|
release_name: Aqua lib ${{ env.FINAL_VERSION }}
|
||||||
|
body: |
|
||||||
|
[${{ env.FINAL_VERSION }} @ NPM registry](https://www.npmjs.com/package/${{ env.PKG_NAME }}/v/${{ env.FINAL_VERSION }})
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
|||||||
|
*.tgz
|
Loading…
x
Reference in New Issue
Block a user