diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..01a341e5a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,22 @@ +name: publishing + +on: + push: + tags: + - '@openameba/*' + +jobs: + publish: + name: publishing + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: 14 + - name: Log in to npm + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + npm whoami + - name: Publishing with lerna + run: npx lerna publish from-git diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 000000000..7eea681b5 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,34 @@ +name: versioning + +on: + push: + branches: + - version/major + - version/minor + - version/patch + - version/premajor + - version/preminor + - version/prepatch + - version/prerelease + +jobs: + version: + name: versioning + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: 14 + - name: Set git user + run: | + git config --global user.email "<>" + git config --global user.name "openameba" + - name: Extract version from branch name + run: echo "::set-output name=version::$(echo ${GITHUB_REF##*/})" + id: extract_version + - name: Versioning with lerna + # also see some options in lerna.json + run: npx lerna version ${{ steps.extract_version.outputs.version }} --conventional-commits --create-release github --yes --no-private + env: + GH_TOKEN: ${{ github.token }} diff --git a/lerna.json b/lerna.json index 0d7955c8e..3e40056bc 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,11 @@ "version": "independent", "packages": [ "packages/*" - ] + ], + "command": { + "version": { + "message": "chore(release): publish", + "allowBranch": "version/*" + } + } } diff --git a/packages/spindle-icons/package.json b/packages/spindle-icons/package.json index 1c934dab5..c406a4f2d 100644 --- a/packages/spindle-icons/package.json +++ b/packages/spindle-icons/package.json @@ -1,6 +1,6 @@ { "name": "@openameba/spindle-icons", - "version": "0.1.0", + "version": "0.0.1", "scripts": { "clean": "npx rimraf dist", "mkdir": "npx mkdirp dist", @@ -16,6 +16,9 @@ "files": [ "dist" ], + "publishConfig": { + "access": "public" + }, "devDependencies": { "@types/cli-progress": "^3.7.0", "axios": "^0.19.2",