forked from Danny-Dasilva/CycleTLS
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.52 KB
/
manual_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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.20']
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
- name: Install jq
run: sudo apt-get install -y jq
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- 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
- 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
- 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
- name: Set module-aware mode
run: go env -w GO111MODULE=auto
- name: Install golang dependencies
run: while read l; do go get -v "$l"; done < <(go list -f '{{ join .Imports "\n" }}' ./cycletls)
shell: bash
- name: Install npm depencencies
run: npm ci --unsafe-perm
- name: Tag Submodule
run: |
VERSION=$(npm version --json | jq -r '.cycletls')
SUBMODULE_VERSION="cycletls/v${VERSION}"
git tag $SUBMODULE_VERSION cycletls/
git push origin $SUBMODULE_VERSION
- name: 🚀 publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN}}
- name: Push git
run: git add * && git commit -a -m "[RELEASE] %s" && git push