-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ποΈ add manual publish for beta releases
- Loading branch information
1 parent
82d2a09
commit 473bed8
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: "π§ π π’ Manual publish" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseCandidate: | ||
description: "Release Candidate" | ||
required: true | ||
default: "beta" | ||
|
||
jobs: | ||
release: | ||
name: π Manual publish | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [15.x] | ||
go-version: [1.16] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: π’ Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: https://registry.npmjs.org | ||
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
- name: set name | ||
run: git config --global user.name 'Danny-Dasilva' | ||
- name: set email | ||
run: git config --global user.email 'secrets.EMAIL' | ||
- name: Get Package Name | ||
run: | | ||
echo "PACKAGE_NAME=$(node -p "try { require('./package.json').name } catch(e) {}")" >> $GITHUB_ENV | ||
id: package | ||
working-directory: ./my-package | ||
- name: Retrieve Latest Version | ||
run: | | ||
echo "::set-output name=LATEST_VERSION::$(npm view ${{ env.PACKAGE_NAME }} version)" | ||
id: version | ||
- name: Update to latest version | ||
run: | | ||
npm version ${{ steps.version.outputs.LATEST_VERSION }} --allow-same-version | ||
working-directory: ./my-package | ||
- name: bump version | ||
run: | | ||
if [[ "${{ github.event.inputs.releaseCandidate }}" == "alpha" ]]; then | ||
npm version prerelease --preid alpha | ||
fi | ||
if [[ "${{ github.event.inputs.releaseCandidate }}" == "beta" ]]; then | ||
npm version prerelease --preid beta | ||
fi | ||
working-directory: ./my-package | ||
|
||
- name: Set module-aware mode | ||
run: go env -w GO111MODULE=auto | ||
|
||
- name: Install golang dependencies | ||
run: go get github.com/Danny-Dasilva/CycleTLS/cycletls && go get github.com/Danny-Dasilva/fhttp && go get github.com/andybalholm/brotli | ||
|
||
- name: Install npm depencencies | ||
run: npm ci --unsafe-perm | ||
|
||
|
||
- name: π publish | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN}} | ||
|
||
- name: Push git | ||
run: git commit -a -m "[RELEASE] %s" && git push |