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

[GSoD 2021] Formatted actions and .vscode files using prettier #142

Closed
wants to merge 12 commits into from
36 changes: 19 additions & 17 deletions .github/workflows/csharp.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
name: "csharp"
name: csharp
on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main
jobs:
build-push:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@master
with:
dotnet-version: 3.1.100
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@master
with:
dotnet-version: 3.1.100

- name: copy wechaty proto
run: .\copy.ps1
working-directory: .\csharp\Wechaty.Grpc\buildTool
shell: powershell
- name: copy wechaty proto
run: .\copy.ps1
working-directory: .\csharp\Wechaty.Grpc\buildTool
shell: powershell

- name: publish on version change
uses: rohith/publish-nuget@v2
with:
PROJECT_FILE_PATH: .\csharp\Wechaty.Grpc\Wechaty.Grpc.csproj
VERSION_FILE_PATH: .\csharp\Wechaty.Grpc\common.props
NUGET_KEY: ${{ secrets.NUGET_APIKEY }}
- name: publish on version change
uses: rohith/publish-nuget@v2
with:
PROJECT_FILE_PATH: .\csharp\Wechaty.Grpc\Wechaty.Grpc.csproj
VERSION_FILE_PATH: .\csharp\Wechaty.Grpc\common.props
NUGET_KEY: ${{ secrets.NUGET_APIKEY }}
94 changes: 46 additions & 48 deletions .github/workflows/go.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,60 @@ name: Go
on: [push, pull_request]

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.14
uses: actions/setup-go@master
with:
stable: false
go-version: 1.14
id: go
- name: Install Protoc
uses: arduino/setup-protoc@master

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
cd go
make install

- name: Build
run: |
cd go
make generate
rm -rf `go env GOPATH`/src/github.com/wechaty/go-grpc/wechaty
ln -s `pwd`/generated/wechaty/ `go env GOPATH`/src/github.com/wechaty/go-grpc/wechaty
go build -v generated/wechaty/puppet.pb.go
- name: Set up Go 1.14
uses: actions/setup-go@master
with:
stable: false
go-version: 1.14
id: go
- name: Install Protoc
uses: arduino/setup-protoc@master

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
cd go
make install

- name: Build
run: |
cd go
make generate
rm -rf `go env GOPATH`/src/github.com/wechaty/go-grpc/wechaty
ln -s `pwd`/generated/wechaty/ `go env GOPATH`/src/github.com/wechaty/go-grpc/wechaty
go build -v generated/wechaty/puppet.pb.go

publish:
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v'))
name: Publish
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@master
with:
stable: false
go-version: 1.14
id: go
- name: Install Protoc
uses: arduino/setup-protoc@master
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Deploy
run: |
cd go
make install
# https://stackoverflow.com/a/4565746/1123955
# https://stackoverflow.com/a/46253163/1123955
ssh-agent bash -c "\
echo '${SSH_PRIVATE_KEY}' | ssh-add - ;\
make publish ;\
"
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up Go 1.14
uses: actions/setup-go@master
with:
stable: false
go-version: 1.14
id: go
- name: Install Protoc
uses: arduino/setup-protoc@master
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Deploy
run: |
cd go
make install
# https://stackoverflow.com/a/4565746/1123955
# https://stackoverflow.com/a/46253163/1123955
ssh-agent bash -c "\
echo '${SSH_PRIVATE_KEY}' | ssh-add - ;\
make publish ;\
"
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
27 changes: 13 additions & 14 deletions .github/workflows/maven-publish.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file java/pom.xml
- name: Build with Maven
run: mvn -B package --file java/pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
21 changes: 11 additions & 10 deletions .github/workflows/maven.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ name: Maven

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file java/pom.xml
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file java/pom.xml
62 changes: 32 additions & 30 deletions .github/workflows/node.js.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ name: Node.js

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main

jobs:
build:
Expand All @@ -23,31 +25,31 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package.json
- name: Set up Go
uses: actions/setup-go@master
id: go

- name: Install Protoc
uses: arduino/setup-protoc@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Dependencies
run: |
npm install
npm run install:protoc

- name: Generate gRPC Stubs
run: npm run generate

- name: Test
run: npm test
env:
CI: true
- uses: actions/checkout@master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package.json
- name: Set up Go
uses: actions/setup-go@master
id: go

- name: Install Protoc
uses: arduino/setup-protoc@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Dependencies
run: |
npm install
npm run install:protoc

- name: Generate gRPC Stubs
run: npm run generate

- name: Test
run: npm test
env:
CI: true
Empty file modified .github/workflows/npm.yml
100644 → 100755
Empty file.
36 changes: 18 additions & 18 deletions .github/workflows/php.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ jobs:
key: cache-v3

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP with extensions and custom config
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Shanghai
tools: protoc, grpc_php_plugin
- name: Testing PHP version
run: |
php -v
php -r "if(strpos(phpversion(), '${{ matrix.php-versions }}') === false) {throw new Exception('Wrong PHP version Installed');}"
- name: Test grpc_php_plugin and protoc
run: |
protoc --version
cd php
make generate
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP with extensions and custom config
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Shanghai
tools: protoc, grpc_php_plugin
- name: Testing PHP version
run: |
php -v
php -r "if(strpos(phpversion(), '${{ matrix.php-versions }}') === false) {throw new Exception('Wrong PHP version Installed');}"
- name: Test grpc_php_plugin and protoc
run: |
protoc --version
cd php
make generate
50 changes: 25 additions & 25 deletions .github/workflows/pypi.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: 3.9
- uses: actions/cache@master
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('python/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: 3.9
- uses: actions/cache@master
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('python/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install Protoc
uses: arduino/setup-protoc@master
- name: Install Protoc 3rd party protos
run: scripts/install-protoc.sh
- name: Install Protoc
uses: arduino/setup-protoc@master
- name: Install Protoc 3rd party protos
run: scripts/install-protoc.sh

- name: Install dependencies
run: |
cd python
python -m pip install --upgrade pip
make install
- name: Test
run: |
cd python
make generate
make test
- name: Install dependencies
run: |
cd python
python -m pip install --upgrade pip
make install
- name: Test
run: |
cd python
make generate
make test

pack:
name: Pack
Expand Down
Loading