Compare commits
211 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6179f79b78 | |||
| 60749c6653 | |||
| 9a0a11423d | |||
| 74c1e87c6b | |||
| 9ea914b370 | |||
| 1bb7228652 | |||
| 3dd92068cf | |||
| a83abcc872 | |||
| 70c22e93a3 | |||
| 8f45305178 | |||
| af4b66354b | |||
| 88d425bbe7 | |||
| 62f6872b4e | |||
| 5802cb7302 | |||
| e3d245e1f3 | |||
| 4f09f99149 | |||
| 4e9268c2d3 | |||
| 0dc4b20ce6 | |||
| 72408e6c62 | |||
| 6adb515f32 | |||
| 4931fda2f6 | |||
| 6ed18cebdc | |||
| 7e8254e985 | |||
| 89ffdad115 | |||
| 782ef79256 | |||
| ffa1f65c2b | |||
| a5c8a8223e | |||
| c411e74e23 | |||
| e5ca822488 | |||
| 03bcd68379 | |||
| d5e8e87192 | |||
| 3556cc2d57 | |||
| adc9b70b37 | |||
| ad5ca30863 | |||
| 20e3ada188 | |||
| 3c5440479d | |||
| f685e29caa | |||
| 0254a244d2 | |||
| 58a75f1304 | |||
| 9bc2c5c75e | |||
| 8c4fc57de8 | |||
| e29256ca8d | |||
| 8dc9fb3b3a | |||
| 947661542c | |||
| eef30f852e | |||
| ddb0b367ee | |||
| 2720260ff7 | |||
| db703268d3 | |||
| 6c7202a657 | |||
| acc6dd8232 | |||
| 9dd8f4e44a | |||
| 06b21b84fd | |||
| 29e8a67beb | |||
| a3f957729c | |||
| 703084fb8c | |||
| 93e77af4c0 | |||
| 67ffe1ea7a | |||
| a2adc6fc73 | |||
| 0c7710ef26 | |||
| 2ac9c51b54 | |||
| 51163e4853 | |||
| ccaa3fe168 | |||
| 20088f9456 | |||
| 0bba821a5d | |||
| 1cd6633355 | |||
| 8635fcacca | |||
| 89a7d6d6fd | |||
| 1355c6f439 | |||
| ecc93c42b3 | |||
| 07d1cc9bfb | |||
| cfe11139ad | |||
| 8beb802437 | |||
| ed5cb0096e | |||
| bffa6f39fb | |||
| 287e743d09 | |||
| 391c5961e9 | |||
| efb9b58902 | |||
| 781776c228 | |||
| 514247182a | |||
| c934669ce2 | |||
| cb7f7926da | |||
| a87d9c70b6 | |||
| 1af242240f | |||
| 223033b681 | |||
| 32e42a51fb | |||
| 66cdd92799 | |||
| 63d39d990b | |||
| 20613d6143 | |||
| 94b39f136f | |||
| 90e0057b61 | |||
| 4e1cbdb464 | |||
| 5ce12321a2 | |||
| 5d2c37103a | |||
| 0c0e0c1a33 | |||
| b0d776c678 | |||
| 325e76073b | |||
| 2ecb907f13 | |||
| 71225d47f5 | |||
| 48ae89ff98 | |||
| e6a211ee2a | |||
| d932133378 | |||
| 8088828c39 | |||
| 4d107f13f7 | |||
| d8d2171b12 | |||
| d037e97e82 | |||
| e5a3a0e112 | |||
| b1cd1732eb | |||
| 43b0ff3ed0 | |||
| 450e791e65 | |||
| d81f56295b | |||
| a93d98e2ef | |||
| 708e95bab1 | |||
| c19bd5e378 | |||
| 3f617a9e90 | |||
| e1de33dd71 | |||
| 533b24eb42 | |||
| 966381e246 | |||
| 0312cce503 | |||
| e82b9dd7b2 | |||
| f2cf5bdb47 | |||
| 595b40510a | |||
| 0de7b7f1ae | |||
| 121d2ab7ff | |||
| 1f997e9a87 | |||
| 48b117b9d3 | |||
| 70678a442f | |||
| 14ce72202c | |||
| ae04f367cd | |||
| ca86544176 | |||
| e675aed815 | |||
| b7bbd0d61b | |||
| 04e15fb463 | |||
| 02907c3386 | |||
| 3216c40dc6 | |||
| 8919cfd5e6 | |||
| 69953a434c | |||
| b8c1015cb2 | |||
| d675ee1249 | |||
| c01d4fce64 | |||
| 3ec148162c | |||
| 6939f3ae6d | |||
| 6150fb4632 | |||
| 481a0913ef | |||
| 611aeebdf7 | |||
| c8833c3887 | |||
| 7b17fb7a4b | |||
| bf76e89bff | |||
| 05a16cf675 | |||
| a33d16cad6 | |||
| 2ce3a0ec1a | |||
| 00e9f4c09e | |||
| ec1515576f | |||
| d905e1a4db | |||
| 8c3d01f201 | |||
| a8bbec5200 | |||
| 30640b57f2 | |||
| c174991b14 | |||
| e9d34e43e5 | |||
| a4dd230e64 | |||
| a8be2ef60a | |||
| c7129d8fd7 | |||
| b1a374cb86 | |||
| bf9694e89a | |||
| 0ce39950d6 | |||
| 254c11de8a | |||
| 272bf3b441 | |||
| 24f2f86d00 | |||
| fbda5df60b | |||
| 62b675a84c | |||
| c7da5a7e80 | |||
| f761ff73ad | |||
| fa623365b4 | |||
| 87b9b0ca12 | |||
| 36419cb342 | |||
| 4529f67135 | |||
| f2e7da9712 | |||
| 28e1d85265 | |||
| 8a8e98dcfe | |||
| 2b82d4e930 | |||
| ad93884ba3 | |||
| 9f247c9a93 | |||
| f83534a553 | |||
| 01383c3f3f | |||
| 23fb7443be | |||
| e53ea0147d | |||
| 8b9421c5a8 | |||
| 59e90d901f | |||
| 039ac063c2 | |||
| f2431fbcb0 | |||
| 9f464a7c99 | |||
| 7ef22763e7 | |||
| 117a695161 | |||
| 8365b9ecb2 | |||
| 7f515b734a | |||
| 65acb4a192 | |||
| b0a460212d | |||
| dcaa948ed3 | |||
| 57d97826a2 | |||
| 03063e080a | |||
| 13af371169 | |||
| 239b6d1b96 | |||
| 93f235a08a | |||
| c2600f2e02 | |||
| 77cce53687 | |||
| bb1f3bb0b8 | |||
| 941b3de36e | |||
| aef55ffd4b | |||
| bc65c241ed | |||
| 654b83e0f3 | |||
| e74b1236d2 | |||
| 3eb436ecce |
@@ -0,0 +1 @@
|
||||
* text=auto
|
||||
@@ -0,0 +1,31 @@
|
||||
Thank you for sending in this pull request. Please make sure you take a look at the [contributing file](https://github.com/actions/starter-workflows/blob/master/CONTRIBUTING.md). Here's a few things for you to consider in this pull request:
|
||||
|
||||
- [ ] Include a good description of the workflow.
|
||||
- [ ] Links to the language or tool will be nice (unless its really obvious)
|
||||
|
||||
In the workflow and properties files:
|
||||
|
||||
- [ ] The workflow filename of CI workflows should be the name of the language or platform, in lower case. Special characters should be removed or replaced with words as appropriate (for example, "dotnet" instead of ".NET").
|
||||
|
||||
The workflow filename of publishing workflows should be the name of the language or platform, in lower case, followed by "-publish".
|
||||
- [ ] Includes a matching `ci/properties/*.properties.json` file.
|
||||
- [ ] Use sentence case for the names of workflows and steps, for example "Run tests".
|
||||
- [ ] The name of CI workflows should only be the name of the language or platform: for example "Go" (not "Go CI" or "Go Build")
|
||||
- [ ] Include comments in the workflow for any parts that are not obvious or could use clarification.
|
||||
- [ ] CI workflows should run on `push` to `branches: [ master ]` and `pull_request` to `branches: [ master ]`.
|
||||
|
||||
Packaging workflows should run on `release` with `types: [ created ]`.
|
||||
|
||||
Some general notes:
|
||||
|
||||
- [ ] This workflow must only use actions that are produced by GitHub, [in the `actions` organization](https://github.com/actions), **or**
|
||||
|
||||
This workflow must only use actions that are produced by the language or ecosystem that the workflow supports. These actions must be [published to the GitHub Marketplace](https://github.com/marketplace?type=actions). Workflows using these actions must reference the action using the full 40 character hash of the action's commit instead of a tag. Additionally, workflows must include the following comment at the top of the workflow file:
|
||||
```
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
```
|
||||
- [ ] This workflow must not send data to any 3rd party service except for the purposes of installing dependencies.
|
||||
- [ ] This workflow must not use a paid service or product.
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Sync workflows for GHES
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
||||
git config user.email "cschleiden@github.com"
|
||||
git config user.name "GitHub Actions"
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12'
|
||||
- name: Check starter workflows for GHES compat
|
||||
run: |
|
||||
npm ci
|
||||
npx ts-node-script ./index.ts
|
||||
working-directory: ./script/sync-ghes
|
||||
- run: |
|
||||
git add -A
|
||||
if [ -z "$(git status --porcelain)" ]; then
|
||||
echo "No changes to commit"
|
||||
else
|
||||
git commit -m "Updating GHES workflows"
|
||||
fi
|
||||
- run: git push
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Validate Data
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "12"
|
||||
|
||||
- name: Validate workflows
|
||||
run: |
|
||||
npm ci
|
||||
npx ts-node-script ./index.ts
|
||||
working-directory: ./script/validate-data
|
||||
@@ -0,0 +1 @@
|
||||
script/**/node_modules
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"args": ["${workspaceRoot}/script/index.ts"],
|
||||
"runtimeArgs": ["-r", "ts-node/register"],
|
||||
"cwd": "${workspaceRoot}/script",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart",
|
||||
"env": {
|
||||
"TS_NODE_IGNORE": "false"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
## Contributing
|
||||
|
||||
[code-of-conduct]: CODE_OF_CONDUCT.md
|
||||
|
||||
Hi there 👋 We are excited that you want to contribute a new workflow to this repo. By doing this you are helping people get up and running with GitHub Actions and that's cool 😎.
|
||||
|
||||
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](https://github.com/actions/starter-workflows/blob/master/LICENSE).
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct](
|
||||
https://github.com/actions/.github/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||
|
||||
Before merging a new workflow, the following requirements need to be met:
|
||||
|
||||
- Should be as simple as is needed for the service.
|
||||
- There are many programming languages and tools out there. Right now we don't have a page that allows for a really large number of workflows, so we do have to be a little choosy about what we accept. Less popular tools or languages might not be accepted.
|
||||
- Should not send data to any 3rd party service except for the purposes of installing dependencies.
|
||||
- Cannot use an Action that isn't in the `actions` organization.
|
||||
- Cannot be to a paid service or product.
|
||||
|
||||
Thank you
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
|
||||
## Starter Workflows
|
||||
|
||||
<img src="https://d3vv6lp55qjaqc.cloudfront.net/items/353A3p3Y2x3c2t2N0c01/Image%202019-08-27%20at%203.25.07%20PM.png" max-width="75%"/>
|
||||
These are the workflow files for helping people get started with GitHub Actions. They're presented whenever you start to create a new GitHub Actions workflow.
|
||||
|
||||
These are the workflow files for helping people get started with GitHub Actions.
|
||||
**If you want to get started with GitHub Actions, you can use these starter workflows by clicking the "Actions" tab in the repository where you want to create a workflow.**
|
||||
|
||||
<img src="https://d3vv6lp55qjaqc.cloudfront.net/items/353A3p3Y2x3c2t2N0c01/Image%202019-08-27%20at%203.25.07%20PM.png" max-width="75%"/>
|
||||
|
||||
**Directory structure:**
|
||||
* [ci](ci): solutions for Continuous Integration
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
name: Greetings
|
||||
description: Greets users who are first time contributors to the repo
|
||||
categories: [Automation, SDLC]
|
||||
iconName: octicon smiley
|
||||
---
|
||||
name: Greetings
|
||||
|
||||
on: [pull_request, issues]
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
---
|
||||
name: Labeler
|
||||
description: Labels pull requests based on the files changed
|
||||
categories: [Automation, SDLC]
|
||||
iconName: octicon tag
|
||||
---
|
||||
# This workflow will triage pull requests and apply a label based on the
|
||||
# paths that are modified in the pull request.
|
||||
#
|
||||
# To use this workflow, you will need to set up a .github/labeler.yml
|
||||
# file with configuration. For more information, see:
|
||||
# https://github.com/actions/labeler/blob/master/README.md
|
||||
|
||||
name: Labeler
|
||||
on: [pull_request]
|
||||
|
||||
@@ -9,4 +22,4 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/labeler@v2
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Greetings",
|
||||
"description": "Greets users who are first time contributors to the repo",
|
||||
"iconName": "octicon smiley",
|
||||
"categories": ["Automation", "SDLC"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Labeler",
|
||||
"description": "Labels pull requests based on the files changed",
|
||||
"iconName": "octicon tag",
|
||||
"categories": ["Automation", "SDLC"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Stale",
|
||||
"description": "Checks for stale issues and pull requests",
|
||||
"iconName": "octicon clock",
|
||||
"categories": ["Automation", "SDLC"]
|
||||
}
|
||||
@@ -1,14 +1,20 @@
|
||||
---
|
||||
name: Stale
|
||||
description: Checks for stale issues and pull requests
|
||||
categories: [Automation, SDLC]
|
||||
iconName: octicon clock
|
||||
---
|
||||
name: Mark stale issues and pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 * * * *"
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v1
|
||||
with:
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
name: Android CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
---
|
||||
name: Android CI
|
||||
description: Build an Android project with Gradle.
|
||||
categories: [Java, Mobile]
|
||||
iconName: android
|
||||
---
|
||||
name: Android CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
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 Gradle
|
||||
run: ./gradlew build
|
||||
|
||||
@@ -1,17 +1,30 @@
|
||||
name: Java CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Build with Ant
|
||||
run: ant -noinput -buildfile build.xml
|
||||
---
|
||||
name: Java with Ant
|
||||
description: Build and test a Java project with Apache Ant.
|
||||
categories: [Ant, Java]
|
||||
iconName: ant
|
||||
---
|
||||
# This workflow will build a Java project with Ant
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant
|
||||
|
||||
name: Java CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
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 Ant
|
||||
run: ant -noinput -buildfile build.xml
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
name: ASP.NET Core CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 2.2.108
|
||||
- name: Build with dotnet
|
||||
run: dotnet build --configuration Release
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
name: Deploy to Amazon ECS
|
||||
description: Deploy a container to an Amazon ECS service powered by AWS Fargate or Amazon EC2.
|
||||
categories: []
|
||||
iconName: aws
|
||||
---
|
||||
# This workflow will build and push a new container image to Amazon ECR,
|
||||
# and then will deploy a new task definition to Amazon ECS, when a release is created
|
||||
#
|
||||
# To use this workflow, you will need to complete the following set-up steps:
|
||||
#
|
||||
# 1. Create an ECR repository to store your images.
|
||||
# For example: `aws ecr create-repository --repository-name my-ecr-repo --region us-east-2`.
|
||||
# Replace the value of `ECR_REPOSITORY` in the workflow below with your repository's name.
|
||||
# Replace the value of `aws-region` in the workflow below with your repository's region.
|
||||
#
|
||||
# 2. Create an ECS task definition, an ECS cluster, and an ECS service.
|
||||
# For example, follow the Getting Started guide on the ECS console:
|
||||
# https://us-east-2.console.aws.amazon.com/ecs/home?region=us-east-2#/firstRun
|
||||
# Replace the values for `service` and `cluster` in the workflow below with your service and cluster names.
|
||||
#
|
||||
# 3. Store your ECS task definition as a JSON file in your repository.
|
||||
# The format should follow the output of `aws ecs register-task-definition --generate-cli-skeleton`.
|
||||
# Replace the value of `task-definition` in the workflow below with your JSON file's name.
|
||||
# Replace the value of `container-name` in the workflow below with the name of the container
|
||||
# in the `containerDefinitions` section of the task definition.
|
||||
#
|
||||
# 4. Store an IAM user access key in GitHub Actions secrets named `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
|
||||
# See the documentation for each action used below for the recommended IAM policies for this IAM user,
|
||||
# and best practices on handling the access key credentials.
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
name: Deploy to Amazon ECS
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-2
|
||||
|
||||
- name: Login to Amazon ECR
|
||||
id: login-ecr
|
||||
uses: aws-actions/amazon-ecr-login@v1
|
||||
|
||||
- name: Build, tag, and push image to Amazon ECR
|
||||
id: build-image
|
||||
env:
|
||||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||
ECR_REPOSITORY: my-ecr-repo
|
||||
IMAGE_TAG: ${{ github.sha }}
|
||||
run: |
|
||||
# Build a docker container and
|
||||
# push it to ECR so that it can
|
||||
# be deployed to ECS.
|
||||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
|
||||
|
||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
||||
id: task-def
|
||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||
with:
|
||||
task-definition: task-definition.json
|
||||
container-name: sample-app
|
||||
image: ${{ steps.build-image.outputs.image }}
|
||||
|
||||
- name: Deploy Amazon ECS task definition
|
||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||
with:
|
||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
||||
service: sample-app-service
|
||||
cluster: default
|
||||
wait-for-service-stability: true
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
name: Deploy Node.js to Azure Web App
|
||||
description: Build a Node.js project and deploy it to an Azure Web App.
|
||||
categories: []
|
||||
iconName: azure
|
||||
---
|
||||
# This workflow will build and push a node.js application to an Azure Web App when a release is created.
|
||||
#
|
||||
# This workflow assumes you have already created the target Azure App Service web app.
|
||||
# For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan
|
||||
#
|
||||
# To configure this workflow:
|
||||
#
|
||||
# 1. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile.
|
||||
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret
|
||||
#
|
||||
# 2. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below).
|
||||
#
|
||||
# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions
|
||||
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
env:
|
||||
AZURE_WEBAPP_NAME: your-app-name # set this to your application's name
|
||||
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
|
||||
NODE_VERSION: '10.x' # set this to the node version to use
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
name: Build and Deploy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: npm install, build, and test
|
||||
run: |
|
||||
# Build and test the project, then
|
||||
# deploy to Azure Web App.
|
||||
npm install
|
||||
npm run build --if-present
|
||||
npm run test --if-present
|
||||
- name: 'Deploy to Azure WebApp'
|
||||
uses: azure/webapps-deploy@v2
|
||||
with:
|
||||
app-name: ${{ env.AZURE_WEBAPP_NAME }}
|
||||
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
|
||||
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
|
||||
@@ -1,17 +1,39 @@
|
||||
name: CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Run a one-line script
|
||||
run: echo Hello, world!
|
||||
- name: Run a multi-line script
|
||||
run: |
|
||||
echo Add other actions to build,
|
||||
echo test, and deploy your project.
|
||||
---
|
||||
name: Simple workflow
|
||||
description: Start with a file with the minimum necessary structure.
|
||||
categories: []
|
||||
iconName: blank
|
||||
---
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: CI
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
# events but only for the master branch
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Runs a single command using the runners shell
|
||||
- name: Run a one-line script
|
||||
run: echo Hello, world!
|
||||
|
||||
# Runs a set of commands using the runners shell
|
||||
- name: Run a multi-line script
|
||||
run: |
|
||||
echo Add other actions to build,
|
||||
echo test, and deploy your project.
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
name: C/C++ CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: configure
|
||||
run: ./configure
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make distcheck
|
||||
run: make distcheck
|
||||
---
|
||||
name: C/C++ with Make
|
||||
description: Build and test a C/C++ project using Make.
|
||||
categories: [C, C++]
|
||||
iconName: c-cpp
|
||||
---
|
||||
name: C/C++ CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: configure
|
||||
run: ./configure
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make distcheck
|
||||
run: make distcheck
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
name: Clojure CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install dependencies
|
||||
run: lein deps
|
||||
- name: Run tests
|
||||
run: lein test
|
||||
---
|
||||
name: Clojure
|
||||
description: Build and test a Clojure project with Leiningen.
|
||||
categories: [Clojure, Java]
|
||||
iconName: clojure
|
||||
---
|
||||
name: Clojure CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: lein deps
|
||||
- name: Run tests
|
||||
run: lein test
|
||||
|
||||
@@ -1,18 +1,28 @@
|
||||
name: Crystal CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: crystallang/crystal
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install dependencies
|
||||
run: shards install
|
||||
- name: Run tests
|
||||
run: crystal spec
|
||||
---
|
||||
name: Crystal
|
||||
description: Build and test a Crystal project.
|
||||
categories: [Crystal]
|
||||
iconName: crystal
|
||||
---
|
||||
name: Crystal CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: crystallang/crystal
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: shards install
|
||||
- name: Run tests
|
||||
run: crystal spec
|
||||
|
||||
@@ -1,18 +1,28 @@
|
||||
name: Dart CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: google/dart:latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install dependencies
|
||||
run: pub get
|
||||
- name: Run tests
|
||||
run: pub run test
|
||||
---
|
||||
name: Dart
|
||||
description: Build and test a Dart project with Pub.
|
||||
categories: [Dart]
|
||||
iconName: dart
|
||||
---
|
||||
name: Dart CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: google/dart:latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: pub get
|
||||
- name: Run tests
|
||||
run: pub run test
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
name: Django
|
||||
description: Build and Test a Django Project
|
||||
categories: [Python, Django]
|
||||
iconName: django
|
||||
---
|
||||
name: Django CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Run Tests
|
||||
run: |
|
||||
python manage.py test
|
||||
@@ -1,14 +1,24 @@
|
||||
name: Docker Image CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
|
||||
---
|
||||
name: Docker image
|
||||
description: Build a Docker image to deploy, run, or push to a registry.
|
||||
categories: [Dockerfile]
|
||||
iconName: docker
|
||||
---
|
||||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
name: Publish Docker Container
|
||||
description: Build, test and push Docker image to GitHub Packages.
|
||||
categories: [Dockerfile]
|
||||
iconName: docker
|
||||
---
|
||||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
# Publish `master` as Docker `latest` image.
|
||||
branches:
|
||||
- master
|
||||
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
- v*
|
||||
|
||||
# Run tests for any PRs.
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
# TODO: Change variable to your image's name.
|
||||
IMAGE_NAME: image
|
||||
|
||||
jobs:
|
||||
# Run tests.
|
||||
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
if [ -f docker-compose.test.yml ]; then
|
||||
docker-compose --file docker-compose.test.yml build
|
||||
docker-compose --file docker-compose.test.yml run sut
|
||||
else
|
||||
docker build . --file Dockerfile
|
||||
fi
|
||||
|
||||
# Push image to GitHub Packages.
|
||||
# See also https://docs.docker.com/docker-hub/builds/
|
||||
push:
|
||||
# Ensure test job passes before pushing image.
|
||||
needs: test
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build image
|
||||
run: docker build . --file Dockerfile --tag $IMAGE_NAME
|
||||
|
||||
- name: Log into registry
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
|
||||
|
||||
# Change all uppercase to lowercase
|
||||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
||||
|
||||
# Strip git ref prefix from version
|
||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
||||
|
||||
# Strip "v" prefix from tag name
|
||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||
|
||||
# Use Docker `latest` tag convention
|
||||
[ "$VERSION" == "master" ] && VERSION=latest
|
||||
|
||||
echo IMAGE_ID=$IMAGE_ID
|
||||
echo VERSION=$VERSION
|
||||
|
||||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
|
||||
docker push $IMAGE_ID:$VERSION
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: .NET Core
|
||||
description: Build and test a .NET Core or ASP.NET Core project.
|
||||
categories: [C#, F#, Visual Basic, ASP, ASP.NET, .NET]
|
||||
iconName: dotnetcore
|
||||
---
|
||||
name: .NET Core
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 3.1.101
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release --no-restore
|
||||
- name: Test
|
||||
run: dotnet test --no-restore --verbosity normal
|
||||
@@ -1,21 +1,30 @@
|
||||
name: Elixir CI
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: elixir:1.9.1-slim
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
mix local.rebar --force
|
||||
mix local.hex --force
|
||||
mix deps.get
|
||||
- name: Run Tests
|
||||
run: mix test
|
||||
---
|
||||
name: Elixir
|
||||
description: Build and test an Elixir project with Mix.
|
||||
categories: [Elixir, Erlang]
|
||||
iconName: elixir
|
||||
---
|
||||
name: Elixir CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup elixir
|
||||
uses: actions/setup-elixir@v1
|
||||
with:
|
||||
elixir-version: 1.9.4 # Define the elixir version [required]
|
||||
otp-version: 22.2 # Define the OTP version [required]
|
||||
- name: Install Dependencies
|
||||
run: mix deps.get
|
||||
- name: Run Tests
|
||||
run: mix test
|
||||
|
||||
@@ -1,18 +1,29 @@
|
||||
name: Erlang CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install dependencies
|
||||
run: rebar get-deps
|
||||
- name: Compile
|
||||
run: rebar compile
|
||||
- name: Run tests
|
||||
run: rebar skip_deps=true eunit
|
||||
---
|
||||
name: Erlang
|
||||
description: Build and test an Erlang project with rebar.
|
||||
categories: [Erlang]
|
||||
iconName: erlang
|
||||
---
|
||||
name: Erlang CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: erlang:22.0.7
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Compile
|
||||
run: rebar3 compile
|
||||
- name: Run tests
|
||||
run: rebar3 do eunit, ct
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
---
|
||||
name: Ruby Gem
|
||||
description: Pushes a Ruby Gem to RubyGems and GitHub Package Registry.
|
||||
categories: [Ruby, SDLC]
|
||||
iconName: ruby-gems
|
||||
---
|
||||
name: Ruby Gem
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -14,7 +18,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Ruby 2.6
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
|
||||
@@ -1,28 +1,43 @@
|
||||
name: Go
|
||||
on: [push]
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.12
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.12
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
if [ -f Gopkg.toml ]; then
|
||||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||
dep ensure
|
||||
fi
|
||||
|
||||
- name: Build
|
||||
run: go build -v .
|
||||
---
|
||||
name: Go
|
||||
description: Build a Go project.
|
||||
categories: [Go]
|
||||
iconName: go
|
||||
---
|
||||
name: Go
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ^1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
if [ -f Gopkg.toml ]; then
|
||||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||
dep ensure
|
||||
fi
|
||||
|
||||
- name: Build
|
||||
run: go build -v .
|
||||
|
||||
- name: Test
|
||||
run: go test -v .
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
---
|
||||
name: Build and Deploy to GKE
|
||||
description: Build a docker container, publish it to Google Container Registry, and deploy to GKE.
|
||||
categories: []
|
||||
iconName: googlegke
|
||||
---
|
||||
# This workflow will build a docker container, publish it to Google Container Registry, and deploy it to GKE when a release is created
|
||||
#
|
||||
# To configure this workflow:
|
||||
#
|
||||
# 1. Ensure that your repository contains the necessary configuration for your Google Kubernetes Engine cluster, including deployment.yml, kustomization.yml, service.yml, etc.
|
||||
#
|
||||
# 2. Set up secrets in your workspace: GKE_PROJECT with the name of the project, GKE_EMAIL with the service account email, GKE_KEY with the Base64 encoded JSON service account key (https://github.com/GoogleCloudPlatform/github-actions/tree/docs/service-account-key/setup-gcloud#inputs).
|
||||
#
|
||||
# 3. Change the values for the GKE_ZONE, GKE_CLUSTER, IMAGE, REGISTRY_HOSTNAME and DEPLOYMENT_NAME environment variables (below).
|
||||
|
||||
name: Build and Deploy to GKE
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
# Environment variables available to all jobs and steps in this workflow
|
||||
env:
|
||||
GKE_PROJECT: ${{ secrets.GKE_PROJECT }}
|
||||
GKE_EMAIL: ${{ secrets.GKE_EMAIL }}
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
GKE_ZONE: us-west1-a
|
||||
GKE_CLUSTER: example-gke-cluster
|
||||
IMAGE: gke-test
|
||||
REGISTRY_HOSTNAME: gcr.io
|
||||
DEPLOYMENT_NAME: gke-test
|
||||
|
||||
jobs:
|
||||
setup-build-publish-deploy:
|
||||
name: Setup, Build, Publish, and Deploy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Setup gcloud CLI
|
||||
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
|
||||
with:
|
||||
version: '270.0.0'
|
||||
service_account_email: ${{ secrets.GKE_EMAIL }}
|
||||
service_account_key: ${{ secrets.GKE_KEY }}
|
||||
|
||||
# Configure docker to use the gcloud command-line tool as a credential helper
|
||||
- run: |
|
||||
# Set up docker to authenticate
|
||||
# via gcloud command-line tool.
|
||||
gcloud auth configure-docker
|
||||
|
||||
# Build the Docker image
|
||||
- name: Build
|
||||
run: |
|
||||
docker build -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/"$IMAGE":"$GITHUB_SHA" \
|
||||
--build-arg GITHUB_SHA="$GITHUB_SHA" \
|
||||
--build-arg GITHUB_REF="$GITHUB_REF" .
|
||||
|
||||
# Push the Docker image to Google Container Registry
|
||||
- name: Publish
|
||||
run: |
|
||||
docker push $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:$GITHUB_SHA
|
||||
|
||||
# Set up kustomize
|
||||
- name: Set up Kustomize
|
||||
run: |
|
||||
curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64
|
||||
chmod u+x ./kustomize
|
||||
|
||||
# Deploy the Docker image to the GKE cluster
|
||||
- name: Deploy
|
||||
run: |
|
||||
gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT
|
||||
./kustomize edit set image $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:${GITHUB_SHA}
|
||||
./kustomize build . | kubectl apply -f -
|
||||
kubectl rollout status deployment/$DEPLOYMENT_NAME
|
||||
kubectl get services -o wide
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
name: Publish Java Package with Gradle
|
||||
description: Build a Java Package using Gradle and publish to GitHub Packages.
|
||||
categories: [Java, Gradle]
|
||||
iconName: gradle
|
||||
---
|
||||
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
|
||||
# For more information see: https://github.com/actions/setup-java#publishing-using-gradle
|
||||
|
||||
name: Gradle Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
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
|
||||
|
||||
- name: Build with Gradle
|
||||
run: gradle build
|
||||
|
||||
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
|
||||
# the publishing section of your build.gradle
|
||||
- name: Publish to GitHub Packages
|
||||
run: gradle publish
|
||||
env:
|
||||
USERNAME: ${{ github.actor }}
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,17 +1,32 @@
|
||||
name: Java CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
---
|
||||
name: Java with Gradle
|
||||
description: Build and test a Java project using a Gradle wrapper script.
|
||||
categories: [Java, Gradle]
|
||||
iconName: gradle
|
||||
---
|
||||
# This workflow will build a Java project with Gradle
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
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: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
|
||||
@@ -1,19 +1,46 @@
|
||||
name: Haskell CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install dependencies
|
||||
run: cabal install --only-dependencies --enable-tests
|
||||
- name: Build
|
||||
run: |
|
||||
cabal configure --enable-tests
|
||||
cabal build
|
||||
- name: Run tests
|
||||
run: cabal test
|
||||
---
|
||||
name: Haskell
|
||||
description: Build and test a Haskell project with Cabal.
|
||||
categories: [Haskell]
|
||||
iconName: haskell
|
||||
---
|
||||
name: Haskell CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-haskell@v1
|
||||
with:
|
||||
ghc-version: '8.8.2'
|
||||
cabal-version: '3.0'
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v1
|
||||
env:
|
||||
cache-name: cache-cabal
|
||||
with:
|
||||
path: ~/.cabal
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cabal update
|
||||
cabal build --only-dependencies --enable-tests --enable-benchmarks
|
||||
- name: Build
|
||||
run: cabal build --enable-tests --enable-benchmarks all
|
||||
- name: Run tests
|
||||
run: cabal test all
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
name: Build and Deploy to IKS
|
||||
description: Build a docker container, publish it to IBM Container Registry, and deploy to IKS.
|
||||
categories: []
|
||||
iconName: ibm
|
||||
---
|
||||
# This workflow will build a docker container, publish it to IBM Container Registry, and deploy it to IKS when a release is created
|
||||
#
|
||||
# To configure this workflow:
|
||||
#
|
||||
# 1. Ensure that your repository contains a Dockerfile
|
||||
# 2. Setup secrets in your repository by going to settings: Create ICR_NAMESPACE and IBM_CLOUD_API_KEY
|
||||
# 3. Change the values for the IBM_CLOUD_REGION, REGISTRY_HOSTNAME, IMAGE_NAME, IKS_CLUSTER, DEPLOYMENT_NAME, and PORT
|
||||
|
||||
name: Build and Deploy to IKS
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
# Environment variables available to all jobs and steps in this workflow
|
||||
env:
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }}
|
||||
IBM_CLOUD_REGION: us-south
|
||||
ICR_NAMESPACE: ${{ secrets.ICR_NAMESPACE }}
|
||||
REGISTRY_HOSTNAME: us.icr.io
|
||||
IMAGE_NAME: iks-test
|
||||
IKS_CLUSTER: example-iks-cluster-name-or-id
|
||||
DEPLOYMENT_NAME: iks-test
|
||||
PORT: 5001
|
||||
|
||||
jobs:
|
||||
setup-build-publish-deploy:
|
||||
name: Setup, Build, Publish, and Deploy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Download and Install IBM Cloud CLI
|
||||
- name: Install IBM Cloud CLI
|
||||
run: |
|
||||
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
|
||||
ibmcloud --version
|
||||
ibmcloud config --check-version=false
|
||||
ibmcloud plugin install -f kubernetes-service
|
||||
ibmcloud plugin install -f container-registry
|
||||
|
||||
# Authenticate with IBM Cloud CLI
|
||||
- name: Authenticate with IBM Cloud CLI
|
||||
run: |
|
||||
ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g default
|
||||
ibmcloud cr region-set "${IBM_CLOUD_REGION}"
|
||||
ibmcloud cr login
|
||||
|
||||
# Build the Docker image
|
||||
- name: Build with Docker
|
||||
run: |
|
||||
docker build -t "$REGISTRY_HOSTNAME"/"$ICR_NAMESPACE"/"$IMAGE_NAME":"$GITHUB_SHA" \
|
||||
--build-arg GITHUB_SHA="$GITHUB_SHA" \
|
||||
--build-arg GITHUB_REF="$GITHUB_REF" .
|
||||
|
||||
# Push the image to IBM Container Registry
|
||||
- name: Push the image to ICR
|
||||
run: |
|
||||
docker push $REGISTRY_HOSTNAME/$ICR_NAMESPACE/$IMAGE_NAME:$GITHUB_SHA
|
||||
|
||||
# Deploy the Docker image to the IKS cluster
|
||||
- name: Deploy to IKS
|
||||
run: |
|
||||
ibmcloud ks cluster config --cluster $IKS_CLUSTER
|
||||
kubectl config current-context
|
||||
kubectl create deployment $DEPLOYMENT_NAME --image=$REGISTRY_HOSTNAME/$ICR_NAMESPACE/$IMAGE_NAME:$GITHUB_SHA --dry-run -o yaml > deployment.yaml
|
||||
kubectl apply -f deployment.yaml
|
||||
kubectl rollout status deployment/$DEPLOYMENT_NAME
|
||||
kubectl create service loadbalancer $DEPLOYMENT_NAME --tcp=80:$PORT --dry-run -o yaml > service.yaml
|
||||
kubectl apply -f service.yaml
|
||||
kubectl get services -o wide
|
||||
@@ -1,16 +1,26 @@
|
||||
name: Jekyll site CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Build the site in the jekyll/builder container
|
||||
run: |
|
||||
docker run \
|
||||
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
|
||||
jekyll/builder:latest /bin/bash -c "chmod 777 srv/jekyll && jekyll build --future"
|
||||
---
|
||||
name: Jekyll
|
||||
description: Package a Jekyll site using the jekyll/builder Docker image.
|
||||
categories: [HTML]
|
||||
iconName: jekyll
|
||||
---
|
||||
name: Jekyll site CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build the site in the jekyll/builder container
|
||||
run: |
|
||||
docker run \
|
||||
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
|
||||
jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future"
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Laravel
|
||||
description: Test a Laravel project.
|
||||
categories: [PHP, Laravel]
|
||||
iconName: php
|
||||
---
|
||||
name: Laravel
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
laravel-tests:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Copy .env
|
||||
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||
- name: Install Dependencies
|
||||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
|
||||
- name: Generate key
|
||||
run: php artisan key:generate
|
||||
- name: Directory Permissions
|
||||
run: chmod -R 777 storage bootstrap/cache
|
||||
- name: Create Database
|
||||
run: |
|
||||
mkdir -p database
|
||||
touch database/database.sqlite
|
||||
- name: Execute tests (Unit and Feature tests) via PHPUnit
|
||||
env:
|
||||
DB_CONNECTION: sqlite
|
||||
DB_DATABASE: database/database.sqlite
|
||||
run: vendor/bin/phpunit
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
name: Publish Java Package with Maven
|
||||
description: Build a Java Package using Maven and publish to GitHub Packages.
|
||||
categories: [Java, Maven]
|
||||
iconName: maven
|
||||
---
|
||||
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
|
||||
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
|
||||
|
||||
name: Maven Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
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
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
|
||||
- name: Publish to GitHub Packages Apache Maven
|
||||
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
@@ -1,17 +1,30 @@
|
||||
name: Java CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Build with Maven
|
||||
run: mvn package --file pom.xml
|
||||
---
|
||||
name: Java with Maven
|
||||
description: Build and test a Java project with Apache Maven.
|
||||
categories: [Java, Maven]
|
||||
iconName: maven
|
||||
---
|
||||
# This workflow will build a Java project with Maven
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||
|
||||
name: Java CI with Maven
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
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 pom.xml
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
name: Node CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [8.x, 10.x, 12.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: npm install, build, and test
|
||||
run: |
|
||||
npm install
|
||||
npm run build --if-present
|
||||
npm test
|
||||
env:
|
||||
CI: true
|
||||
---
|
||||
name: Node.js
|
||||
description: Build and test a Node.js project with npm.
|
||||
categories: [JavaScript, Node, Npm]
|
||||
iconName: nodejs
|
||||
---
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
---
|
||||
name: Publish Node.js Package
|
||||
description: Publishes a Node.js package to npm and GitHub Packages.
|
||||
categories: [JavaScript, SDLC]
|
||||
iconName: node-package-transparent
|
||||
---
|
||||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
||||
|
||||
name: Node.js Package
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
@@ -23,11 +28,12 @@ jobs:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
||||
@@ -36,12 +42,12 @@ jobs:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://npm.pkg.github.com/
|
||||
scope: '@your-github-username'
|
||||
- run: npm ci
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
name: PHP
|
||||
description: Build and test a PHP application using Composer
|
||||
categories: [PHP, Composer]
|
||||
iconName: php
|
||||
---
|
||||
name: PHP Composer
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
run: composer validate
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --prefer-dist --no-progress
|
||||
|
||||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
|
||||
# Docs: https://getcomposer.org/doc/articles/scripts.md
|
||||
|
||||
# - name: Run test suite
|
||||
# run: composer run-script test
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Android CI",
|
||||
"description": "Build an Android project with Gradle.",
|
||||
"iconName": "android",
|
||||
"categories": ["Java", "Mobile"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Java with Ant",
|
||||
"description": "Build and test a Java project with Apache Ant.",
|
||||
"iconName": "ant",
|
||||
"categories": ["Ant", "Java"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "ASP.NET Core",
|
||||
"description": "Build and test an ASP.NET Core project targeting .NET Core.",
|
||||
"iconName": "dotnetcore",
|
||||
"categories": ["ASP", "ASP.NET", ".NET"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Simple workflow",
|
||||
"description": "Start with a file with the minimum necessary structure.",
|
||||
"iconName": "blank",
|
||||
"categories": null
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "C/C++ with Make",
|
||||
"description": "Build and test a C/C++ project using Make.",
|
||||
"iconName": "c-cpp",
|
||||
"categories": ["C", "C++"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Clojure",
|
||||
"description": "Build and test a Clojure project with Leiningen.",
|
||||
"iconName": "clojure",
|
||||
"categories": ["Clojure", "Java"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Crystal",
|
||||
"description": "Build and test a Crystal project.",
|
||||
"iconName": "crystal",
|
||||
"categories": ["Crystal"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Dart",
|
||||
"description": "Build and test a Dart project with Pub.",
|
||||
"iconName": "dart",
|
||||
"categories": ["Dart"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Docker image",
|
||||
"description": "Build a Docker image to deploy, run, or push to a registry.",
|
||||
"iconName": "docker",
|
||||
"categories": ["Dockerfile"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Elixir",
|
||||
"description": "Build and test an Elixir project with Mix.",
|
||||
"iconName": "elixir",
|
||||
"categories": ["Elixir", "Erlang"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Erlang",
|
||||
"description": "Build and test an Erlang project with rebar.",
|
||||
"iconName": "erlang",
|
||||
"categories": ["Erlang"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Ruby Gem",
|
||||
"description": "Pushes a Ruby Gem to RubyGems and GitHub Package Registry.",
|
||||
"iconName": "ruby-gems",
|
||||
"categories": ["Ruby", "SDLC"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Go",
|
||||
"description": "Build a Go project.",
|
||||
"iconName": "go",
|
||||
"categories": ["Go"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Gradle",
|
||||
"description": "Build and test a Java project using a Gradle wrapper script.",
|
||||
"iconName": "gradle",
|
||||
"categories": ["Java", "Gradle"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Haskell",
|
||||
"description": "Build and test a Haskell project with Cabal.",
|
||||
"iconName": "haskell",
|
||||
"categories": ["Haskell"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Jekyll",
|
||||
"description": "Package a Jekyll site using the jekyll/builder Docker image.",
|
||||
"iconName": "jekyll",
|
||||
"categories": ["HTML"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Maven",
|
||||
"description": "Build and test a Java project with Apache Maven.",
|
||||
"iconName": "maven",
|
||||
"categories": ["Java", "Maven"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Node.js",
|
||||
"description": "Build and test a Node.js project with npm.",
|
||||
"iconName": "nodejs",
|
||||
"categories": ["JavaScript", "Node", "Npm"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Node.js Package",
|
||||
"description": "Publishes a Node.js package to npm and GitHub Package Registry.",
|
||||
"iconName": "node-package-transparent",
|
||||
"categories": ["JavaScript", "SDLC"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Python package",
|
||||
"description": "Create and test a Python package on multiple Python versions.",
|
||||
"iconName": "python",
|
||||
"categories": ["Python"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Ruby",
|
||||
"description": "Build and test a Ruby project with Rake.",
|
||||
"iconName": "ruby",
|
||||
"categories": ["Ruby"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Rust",
|
||||
"description": "Build and test a Rust project with Cargo.",
|
||||
"iconName": "rust",
|
||||
"categories": ["Rust"]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
name: Python application
|
||||
description: Create and test a Python application.
|
||||
categories: [Python]
|
||||
iconName: python
|
||||
---
|
||||
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
||||
|
||||
name: Python application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 pytest
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
||||
@@ -1,34 +1,45 @@
|
||||
name: Python package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: [2.7, 3.5, 3.6, 3.7]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
pip install flake8
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pip install pytest
|
||||
pytest
|
||||
---
|
||||
name: Python package
|
||||
description: Create and test a Python package on multiple Python versions.
|
||||
categories: [Python]
|
||||
iconName: python
|
||||
---
|
||||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
||||
|
||||
name: Python package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.5, 3.6, 3.7, 3.8]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 pytest
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: Publish Python Package
|
||||
description: Publish a Python Package to PyPI on release.
|
||||
categories: [Python]
|
||||
iconName: python
|
||||
---
|
||||
# This workflows will upload a Python Package using Twine when a release is created
|
||||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel twine
|
||||
- name: Build and publish
|
||||
env:
|
||||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
twine upload dist/*
|
||||
@@ -1,20 +1,39 @@
|
||||
name: Ruby
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Ruby 2.6
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6.x
|
||||
- name: Build and test with Rake
|
||||
run: |
|
||||
gem install bundler
|
||||
bundle install --jobs 4 --retry 3
|
||||
bundle exec rake
|
||||
---
|
||||
name: Ruby
|
||||
description: Build and test a Ruby project with Rake.
|
||||
categories: [Ruby]
|
||||
iconName: ruby
|
||||
---
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
||||
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
||||
|
||||
name: Ruby
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Ruby
|
||||
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
||||
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
||||
# uses: ruby/setup-ruby@v1
|
||||
uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- name: Install dependencies
|
||||
run: bundle install
|
||||
- name: Run tests
|
||||
run: bundle exec rake
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
name: Rust
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Build
|
||||
run: cargo build --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
---
|
||||
name: Rust
|
||||
description: Build and test a Rust project with Cargo.
|
||||
categories: [Rust]
|
||||
iconName: rust
|
||||
---
|
||||
name: Rust
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: cargo build --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Scala
|
||||
description: Build and test a Scala project with SBT.
|
||||
categories: [Scala, Java]
|
||||
iconName: scala
|
||||
---
|
||||
name: Scala CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
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: Run tests
|
||||
run: sbt test
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: Swift
|
||||
description: Build and test a Swift Package.
|
||||
categories: [Swift]
|
||||
iconName: swift
|
||||
---
|
||||
name: Swift
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: swift build -v
|
||||
- name: Run tests
|
||||
run: swift test -v
|
||||
@@ -0,0 +1,81 @@
|
||||
---
|
||||
name: Tencent Kubernetes Engine
|
||||
description: This workflow will build a docker container, publish and deploy it to Tencent Kubernetes Engine (TKE).
|
||||
categories: []
|
||||
iconName: tencentcloud
|
||||
---
|
||||
# This workflow will build a docker container, publish and deploy it to Tencent Kubernetes Engine (TKE).
|
||||
#
|
||||
# To configure this workflow:
|
||||
#
|
||||
# 1. Ensure that your repository contains the necessary configuration for your Tencent Kubernetes Engine cluster,
|
||||
# including deployment.yml, kustomization.yml, service.yml, etc.
|
||||
#
|
||||
# 2. Set up secrets in your workspace:
|
||||
# - TENCENT_CLOUD_SECRET_ID with Tencent Cloud secret id
|
||||
# - TENCENT_CLOUD_SECRET_KEY with Tencent Cloud secret key
|
||||
# - TENCENT_CLOUD_ACCOUNT_ID with Tencent Cloud account id
|
||||
# - TKE_REGISTRY_PASSWORD with TKE registry password
|
||||
#
|
||||
# 3. Change the values for the TKE_IMAGE_URL, TKE_REGION, TKE_CLUSTER_ID and DEPLOYMENT_NAME environment variables (below).
|
||||
|
||||
name: Tencent Kubernetes Engine
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
# Environment variables available to all jobs and steps in this workflow
|
||||
env:
|
||||
TKE_IMAGE_URL: ccr.ccs.tencentyun.com/demo/mywebapp
|
||||
TKE_REGION: ap-guangzhou
|
||||
TKE_CLUSTER_ID: cls-mywebapp
|
||||
DEPLOYMENT_NAME: tke-test
|
||||
|
||||
jobs:
|
||||
setup-build-publish-deploy:
|
||||
name: Setup, Build, Publish, and Deploy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Build
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t ${TKE_IMAGE_URL}:${GITHUB_SHA} .
|
||||
|
||||
- name: Login TKE Registry
|
||||
run: |
|
||||
docker login -u ${{ secrets.TENCENT_CLOUD_ACCOUNT_ID }} -p ${{ secrets.TKE_REGISTRY_PASSWORD }} ${TKE_IMAGE_URL}
|
||||
|
||||
# Push the Docker image to TKE Registry
|
||||
- name: Publish
|
||||
run: |
|
||||
docker push ${TKE_IMAGE_URL}:${GITHUB_SHA}
|
||||
|
||||
- name: Set up Kustomize
|
||||
run: |
|
||||
curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64
|
||||
chmod u+x ./kustomize
|
||||
|
||||
- name: Set up ~/.kube/config for connecting TKE cluster
|
||||
uses: TencentCloud/tke-cluster-credential-action@v1
|
||||
with:
|
||||
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
|
||||
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
|
||||
tke_region: ${{ env.TKE_REGION }}
|
||||
cluster_id: ${{ env.TKE_CLUSTER_ID }}
|
||||
|
||||
- name: Switch to TKE context
|
||||
run: |
|
||||
kubectl config use-context ${TKE_CLUSTER_ID}-context-default
|
||||
|
||||
# Deploy the Docker image to the TKE cluster
|
||||
- name: Deploy
|
||||
run: |
|
||||
./kustomize edit set image ${TKE_IMAGE_URL}:${GITHUB_SHA}
|
||||
./kustomize build . | kubectl apply -f -
|
||||
kubectl rollout status deployment/${DEPLOYMENT_NAME}
|
||||
kubectl get services -o wide
|
||||
@@ -0,0 +1,96 @@
|
||||
---
|
||||
name: Terraform
|
||||
description: Set up Terraform CLI in your GitHub Actions workflow.
|
||||
categories: []
|
||||
iconName: terraform
|
||||
---
|
||||
# This workflow installs the latest version of Terraform CLI and configures the Terraform CLI configuration file
|
||||
# with an API token for Terraform Cloud (app.terraform.io). On pull request events, this workflow will run
|
||||
# `terraform init`, `terraform fmt`, and `terraform plan` (speculative plan via Terraform Cloud). On push events
|
||||
# to the master branch, `terraform apply` will be executed.
|
||||
#
|
||||
# Documentation for `hashicorp/setup-terraform` is located here: https://github.com/hashicorp/setup-terraform
|
||||
#
|
||||
# To use this workflow, you will need to complete the following setup steps.
|
||||
#
|
||||
# 1. Create a `main.tf` file in the root of this repository with the `remote` backend and one or more resources defined.
|
||||
# Example `main.tf`:
|
||||
# # The configuration for the `remote` backend.
|
||||
# terraform {
|
||||
# backend "remote" {
|
||||
# # The name of your Terraform Cloud organization.
|
||||
# organization = "example-organization"
|
||||
#
|
||||
# # The name of the Terraform Cloud workspace to store Terraform state files in.
|
||||
# workspaces {
|
||||
# name = "example-workspace"
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# # An example resource that does nothing.
|
||||
# resource "null_resource" "example" {
|
||||
# triggers = {
|
||||
# value = "A example resource that does nothing!"
|
||||
# }
|
||||
# }
|
||||
#
|
||||
#
|
||||
# 2. Generate a Terraform Cloud user API token and store it as a GitHub secret (e.g. TF_API_TOKEN) on this repository.
|
||||
# Documentation:
|
||||
# - https://www.terraform.io/docs/cloud/users-teams-organizations/api-tokens.html
|
||||
# - https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
|
||||
#
|
||||
# 3. Reference the GitHub secret in step using the `hashicorp/setup-terraform` GitHub Action.
|
||||
# Example:
|
||||
# - name: Setup Terraform
|
||||
# uses: hashicorp/setup-terraform@v1
|
||||
# with:
|
||||
# cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
|
||||
|
||||
name: 'Terraform'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
terraform:
|
||||
name: 'Terraform'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
# Checkout the repository to the GitHub Actions runner
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
|
||||
- name: Setup Terraform
|
||||
uses: hashicorp/setup-terraform@v1
|
||||
with:
|
||||
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
|
||||
|
||||
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
|
||||
- name: Terraform Init
|
||||
run: terraform init
|
||||
|
||||
# Checks that all Terraform configuration files adhere to a canonical format
|
||||
- name: Terraform Format
|
||||
run: terraform fmt -check
|
||||
|
||||
# Generates an execution plan for Terraform
|
||||
- name: Terraform Plan
|
||||
run: terraform plan
|
||||
|
||||
# On push to master, build or change infrastructure according to Terraform configuration files
|
||||
# Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks
|
||||
- name: Terraform Apply
|
||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||
run: terraform apply -auto-approve
|
||||
@@ -0,0 +1,121 @@
|
||||
---
|
||||
name: WPF .NET Core
|
||||
description: Build, test and publish a Wpf application built on .NET Core.
|
||||
categories: [C#, Visual Basic, WPF, .NET]
|
||||
iconName: dotnetcore
|
||||
---
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
# This workflow will build, test and package a WPF desktop application
|
||||
# built on .NET Core.
|
||||
# To learn how to migrate your existing WPF application to .NET Core,
|
||||
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
|
||||
#
|
||||
# To configure this workflow:
|
||||
#
|
||||
# 1. Configure environment variables
|
||||
# GitHub sets default environment variables for every workflow run.
|
||||
# Replace the variables relative to your project in the "env" section below.
|
||||
#
|
||||
# 2. Signing
|
||||
# Generate a signing certificate in the Windows Application
|
||||
# Packaging Project or add an existing signing certificate to the project.
|
||||
# Next, use PowerShell to encode the .pfx file using Base64 encoding
|
||||
# by running the following Powershell script to generate the output string:
|
||||
#
|
||||
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
|
||||
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
|
||||
#
|
||||
# Open the output file, SigningCertificate_Encoded.txt, and copy the
|
||||
# string inside. Then, add the string to the repo as a GitHub secret
|
||||
# and name it "Base64_Encoded_Pfx."
|
||||
# For more information on how to configure your signing certificate for
|
||||
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
|
||||
#
|
||||
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
|
||||
# See "Build the Windows Application Packaging project" below to see how the secret is used.
|
||||
#
|
||||
# For more information on GitHub Actions, refer to https://github.com/features/actions
|
||||
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
|
||||
# refer to https://github.com/microsoft/github-actions-for-desktop-apps
|
||||
|
||||
name: WPF .NET Core
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
configuration: [Debug, Release]
|
||||
|
||||
runs-on: windows-latest # For a list of available runner types, refer to
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
|
||||
|
||||
env:
|
||||
Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln.
|
||||
Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
|
||||
Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
|
||||
Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# Install the .NET Core workload
|
||||
- name: Install .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 3.1.101
|
||||
|
||||
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@2008f912f56e61277eefaac6d1888b750582aa16
|
||||
|
||||
# Execute all unit tests in the solution
|
||||
- name: Execute unit tests
|
||||
run: dotnet test
|
||||
|
||||
# Restore the WPF application to populate the obj folder with RuntimeIdentifiers
|
||||
- name: Restore the WPF application
|
||||
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
|
||||
env:
|
||||
Configuration: ${{ matrix.configuration }}
|
||||
|
||||
# Decode the base 64 encoded pfx and save the Signing_Certificate
|
||||
- name: Decode the pfx
|
||||
run: |
|
||||
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
|
||||
$certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
|
||||
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
|
||||
|
||||
# Create the app package by building and packaging the Windows Application Packaging project
|
||||
- name: Create the app package
|
||||
run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
|
||||
env:
|
||||
Appx_Bundle: Always
|
||||
Appx_Bundle_Platforms: x86|x64
|
||||
Appx_Package_Build_Mode: StoreUpload
|
||||
Configuration: ${{ matrix.configuration }}
|
||||
|
||||
# Remove the pfx
|
||||
- name: Remove the pfx
|
||||
run: Remove-Item -path $env:Wap_Project_Directory\$env:Signing_Certificate
|
||||
|
||||
# Upload the MSIX package: https://github.com/marketplace/actions/upload-artifact
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: MSIX Package
|
||||
path: ${{ env.Wap_Project_Directory }}\AppPackages
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="302" height="180" viewBox="0 0 302 180"><g fill="none"><path fill="#252F3E" d="M85.4 65.4c0 3.7.4 6.7 1.1 8.9.8 2.2 1.8 4.6 3.2 7.2.5.8.7 1.6.7 2.3 0 1-.6 2-1.9 3L82.2 91c-.9.6-1.8.9-2.6.9-1 0-2-.5-3-1.4-1.4-1.5-2.6-3.1-3.6-4.7-1-1.7-2-3.6-3.1-5.9-7.8 9.2-17.6 13.8-29.4 13.8-8.4 0-15.1-2.4-20-7.2-4.9-4.8-7.4-11.2-7.4-19.2 0-8.5 3-15.4 9.1-20.6 6.1-5.2 14.2-7.8 24.5-7.8 3.4 0 6.9.3 10.6.8 3.7.5 7.5 1.3 11.5 2.2v-7.3c0-7.6-1.6-12.9-4.7-16-3.2-3.1-8.6-4.6-16.3-4.6-3.5 0-7.1.4-10.8 1.3-3.7.9-7.3 2-10.8 3.4-1.6.7-2.8 1.1-3.5 1.3-.7.2-1.2.3-1.6.3-1.4 0-2.1-1-2.1-3.1v-4.9c0-1.6.2-2.8.7-3.5.5-.7 1.4-1.4 2.8-2.1 3.5-1.8 7.7-3.3 12.6-4.5C40 .9 45.2.3 50.7.3 62.6.3 71.3 3 76.9 8.4c5.5 5.4 8.3 13.6 8.3 24.6v32.4h.2zM44.8 80.6c3.3 0 6.7-.6 10.3-1.8 3.6-1.2 6.8-3.4 9.5-6.4 1.6-1.9 2.8-4 3.4-6.4.6-2.4 1-5.3 1-8.7v-4.2c-2.9-.7-6-1.3-9.2-1.7-3.2-.4-6.3-.6-9.4-.6-6.7 0-11.6 1.3-14.9 4-3.3 2.7-4.9 6.5-4.9 11.5 0 4.7 1.2 8.2 3.7 10.6 2.4 2.5 5.9 3.7 10.5 3.7zm80.3 10.8c-1.8 0-3-.3-3.8-1-.8-.6-1.5-2-2.1-3.9L95.7 9.2c-.6-2-.9-3.3-.9-4 0-1.6.8-2.5 2.4-2.5h9.8c1.9 0 3.2.3 3.9 1 .8.6 1.4 2 2 3.9l16.8 66.2 15.6-66.2c.5-2 1.1-3.3 1.9-3.9.8-.6 2.2-1 4-1h8c1.9 0 3.2.3 4 1 .8.6 1.5 2 1.9 3.9l15.8 67 17.3-67c.6-2 1.3-3.3 2-3.9.8-.6 2.1-1 3.9-1h9.3c1.6 0 2.5.8 2.5 2.5 0 .5-.1 1-.2 1.6-.1.6-.3 1.4-.7 2.5l-24.1 77.3c-.6 2-1.3 3.3-2.1 3.9-.8.6-2.1 1-3.8 1h-8.6c-1.9 0-3.2-.3-4-1-.8-.7-1.5-2-1.9-4L155 22l-15.4 64.4c-.5 2-1.1 3.3-1.9 4-.8.7-2.2 1-4 1h-8.6zm128.5 2.7c-5.2 0-10.4-.6-15.4-1.8-5-1.2-8.9-2.5-11.5-4-1.6-.9-2.7-1.9-3.1-2.8-.4-.9-.6-1.9-.6-2.8v-5.1c0-2.1.8-3.1 2.3-3.1.6 0 1.2.1 1.8.3.6.2 1.5.6 2.5 1 3.4 1.5 7.1 2.7 11 3.5 4 .8 7.9 1.2 11.9 1.2 6.3 0 11.2-1.1 14.6-3.3 3.4-2.2 5.2-5.4 5.2-9.5 0-2.8-.9-5.1-2.7-7-1.8-1.9-5.2-3.6-10.1-5.2L245 51c-7.3-2.3-12.7-5.7-16-10.2-3.3-4.4-5-9.3-5-14.5 0-4.2.9-7.9 2.7-11.1 1.8-3.2 4.2-6 7.2-8.2 3-2.3 6.4-4 10.4-5.2 4-1.2 8.2-1.7 12.6-1.7 2.2 0 4.5.1 6.7.4 2.3.3 4.4.7 6.5 1.1 2 .5 3.9 1 5.7 1.6 1.8.6 3.2 1.2 4.2 1.8 1.4.8 2.4 1.6 3 2.5.6.8.9 1.9.9 3.3v4.7c0 2.1-.8 3.2-2.3 3.2-.8 0-2.1-.4-3.8-1.2-5.7-2.6-12.1-3.9-19.2-3.9-5.7 0-10.2.9-13.3 2.8-3.1 1.9-4.7 4.8-4.7 8.9 0 2.8 1 5.2 3 7.1 2 1.9 5.7 3.8 11 5.5l14.2 4.5c7.2 2.3 12.4 5.5 15.5 9.6 3.1 4.1 4.6 8.8 4.6 14 0 4.3-.9 8.2-2.6 11.6-1.8 3.4-4.2 6.4-7.3 8.8-3.1 2.5-6.8 4.3-11.1 5.6-4.5 1.4-9.2 2.1-14.3 2.1z"/><g fill="#F90"><path d="M272.5 142.7c-32.9 24.3-80.7 37.2-121.8 37.2-57.6 0-109.5-21.3-148.7-56.7-3.1-2.8-.3-6.6 3.4-4.4 42.4 24.6 94.7 39.5 148.8 39.5 36.5 0 76.6-7.6 113.5-23.2 5.5-2.5 10.2 3.6 4.8 7.6z"/><path d="M286.2 127.1c-4.2-5.4-27.8-2.6-38.5-1.3-3.2.4-3.7-2.4-.8-4.5 18.8-13.2 49.7-9.4 53.3-5 3.6 4.5-1 35.4-18.6 50.2-2.7 2.3-5.3 1.1-4.1-1.9 4-9.9 12.9-32.2 8.7-37.5z"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1995" viewBox="0 0 161.67 129" width="2500" xmlns="http://www.w3.org/2000/svg"><path d="m88.33 0-47.66 41.33-40.67 73h36.67zm6.34 9.67-20.34 57.33 39 49-75.66 13h124z" fill="#0072c6"/></svg>
|
||||
|
After Width: | Height: | Size: 203 B |
|
After Width: | Height: | Size: 9.3 KiB |
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||
width="3200.000000pt" height="1500.000000pt" viewBox="0 0 3200.000000 1500.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
<metadata>
|
||||
Created by potrace 1.16, written by Peter Selinger 2001-2019
|
||||
</metadata>
|
||||
<g transform="translate(0.000000,1500.000000) scale(0.100000,-0.100000)"
|
||||
fill="#000000" stroke="none">
|
||||
<path d="M17693 7818 c2 -1280 4 -1367 21 -1423 46 -152 139 -269 258 -325
|
||||
118 -55 164 -62 411 -67 l227 -5 0 246 0 246 -140 0 -140 0 0 1345 0 1345
|
||||
-320 0 -320 0 3 -1362z"/>
|
||||
<path d="M25360 8530 c0 -357 -3 -650 -8 -650 -4 0 -21 30 -36 66 -59 134
|
||||
-159 235 -299 298 -107 49 -166 61 -302 60 -450 -3 -724 -268 -820 -794 -26
|
||||
-141 -32 -517 -11 -676 41 -310 127 -514 282 -670 65 -65 98 -89 176 -128 211
|
||||
-104 478 -115 673 -26 137 62 260 188 306 313 12 31 26 57 30 57 5 0 9 -85 9
|
||||
-190 l0 -190 320 0 320 0 0 1590 0 1590 -320 0 -320 0 0 -650z m-228 -768
|
||||
c109 -39 194 -122 219 -214 6 -24 9 -187 7 -441 l-3 -402 -27 -51 c-62 -118
|
||||
-202 -188 -378 -187 -146 0 -259 57 -337 171 -73 107 -76 127 -81 464 -4 324
|
||||
1 366 54 472 47 94 144 175 243 203 67 19 232 11 303 -15z"/>
|
||||
<path d="M15905 9034 c-493 -76 -839 -381 -999 -880 -109 -341 -125 -821 -41
|
||||
-1196 92 -408 319 -718 639 -873 203 -98 359 -130 636 -130 210 0 292 12 440
|
||||
62 270 92 498 294 649 573 l40 76 -252 146 c-138 81 -259 149 -268 153 -12 4
|
||||
-20 -5 -33 -39 -28 -73 -107 -186 -172 -246 -176 -163 -465 -198 -702 -85 -85
|
||||
40 -191 139 -236 220 -42 76 -83 210 -95 310 -14 114 -14 633 -1 745 46 380
|
||||
276 600 630 600 240 0 407 -97 505 -292 25 -50 45 -96 45 -104 0 -8 4 -14 10
|
||||
-14 7 0 544 275 559 286 2 2 -18 42 -43 91 -191 358 -474 553 -871 602 -120
|
||||
15 -329 12 -440 -5z"/>
|
||||
<path d="M6000 8850 l0 -150 210 0 210 0 0 -1200 0 -1200 -210 0 -210 0 0
|
||||
-150 0 -150 600 0 600 0 0 150 0 150 -210 0 -210 0 0 1200 0 1200 210 0 210 0
|
||||
0 150 0 150 -600 0 -600 0 0 -150z"/>
|
||||
<path d="M7860 7500 l0 -1501 748 3 c672 3 753 5 807 21 278 80 499 328 559
|
||||
627 73 367 -35 667 -299 828 -59 36 -191 82 -234 82 -48 0 -38 26 15 39 191
|
||||
48 337 186 400 378 27 83 29 98 29 253 0 189 -11 243 -77 380 -33 68 -57 100
|
||||
-127 170 -97 97 -194 152 -336 192 -79 22 -91 22 -782 26 l-703 3 0 -1501z
|
||||
m1338 1165 c168 -40 275 -152 301 -316 14 -81 14 -236 1 -314 -13 -80 -61
|
||||
-174 -111 -220 -54 -49 -148 -92 -229 -104 -38 -6 -249 -11 -502 -11 l-438 0
|
||||
0 490 0 490 458 0 c368 0 469 -3 520 -15z m70 -1290 c181 -43 299 -162 332
|
||||
-334 13 -69 13 -302 0 -371 -32 -171 -153 -293 -331 -335 -52 -12 -153 -15
|
||||
-556 -15 l-493 0 0 535 0 535 493 0 c401 0 504 -3 555 -15z"/>
|
||||
<path d="M10670 7500 l0 -1500 175 0 175 0 0 1260 c0 1008 3 1260 13 1260 7 0
|
||||
56 -89 110 -197 132 -266 860 -1603 869 -1595 19 20 739 1344 844 1555 68 136
|
||||
129 247 134 247 7 0 10 -432 10 -1265 l0 -1265 175 0 175 0 0 1500 0 1500
|
||||
-236 -2 -236 -3 -431 -808 c-238 -444 -436 -806 -440 -804 -4 1 -200 364 -436
|
||||
807 l-428 805 -237 3 -236 2 0 -1500z"/>
|
||||
<path d="M19753 8300 c-302 -38 -545 -182 -702 -413 -238 -350 -268 -982 -67
|
||||
-1393 136 -276 360 -454 656 -519 103 -22 324 -30 433 -16 478 64 790 387 872
|
||||
901 22 140 22 400 0 540 -65 408 -282 704 -611 832 -42 16 -116 38 -163 49
|
||||
-101 22 -314 32 -418 19z m338 -533 c96 -46 163 -134 194 -254 19 -72 22 -670
|
||||
4 -755 -43 -204 -210 -325 -423 -305 -143 13 -241 79 -301 200 -50 102 -58
|
||||
179 -53 529 4 268 6 299 26 360 29 85 76 153 136 195 74 51 125 63 251 60 96
|
||||
-3 117 -6 166 -30z"/>
|
||||
<path d="M21393 7443 c3 -783 4 -822 24 -908 60 -262 172 -424 356 -515 115
|
||||
-57 202 -73 357 -67 98 4 142 10 206 31 156 50 279 158 355 311 23 47 46 85
|
||||
51 85 4 0 8 -85 8 -190 l0 -190 315 0 315 0 0 1130 0 1130 -315 0 -315 0 0
|
||||
-753 c0 -826 1 -811 -60 -894 -66 -89 -195 -145 -340 -146 -158 -1 -251 66
|
||||
-301 218 -10 31 -15 206 -19 805 l-5 765 -318 3 -318 2 4 -817z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg width="48" height="48" enable-background="new 0 0 2000 750" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><g transform="matrix(1.25,0,0,-1.25,0,750)"><g transform="matrix(.1059 0 0 .1059 -30.649 546.7)"><linearGradient id="path2432_1_" x1="550.94" x2="554.04" y1="-16.914" y2="-16.914" gradientTransform="matrix(90 0 0 -90 -49226 -1256.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#444" offset="0"/><stop offset="1"/></linearGradient><path d="m359.29 280.16v-27.892c0-4.702 101.44-12.576 167.53-27.893 31.926 7.402 55.61 16.534 55.61 27.893v27.892c0 11.351-23.684 20.493-55.61 27.892-66.089-15.319-167.53-23.195-167.53-27.892" fill="url(#path2432_1_)"/></g><g transform="matrix(.1059 0 0 .1059 -30.649 546.7)"><linearGradient id="path2452_1_" x1="550.94" x2="554.04" y1="-17.754" y2="-17.754" gradientTransform="matrix(90 0 0 -90 -49226 -1220.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#444" offset="0"/><stop offset="1"/></linearGradient><path d="m359.29 391.73v-27.893c0-4.702 101.44-12.576 167.53-27.892 31.926 7.399 55.61 16.534 55.61 27.892v27.893c0 11.352-23.684 20.492-55.61 27.892-66.089-15.319-167.53-23.195-167.53-27.892" fill="url(#path2452_1_)"/></g><g transform="matrix(.1059 0 0 .1059 -30.649 546.7)"><linearGradient id="path2572_1_" x1="550.94" x2="554.04" y1="-17.334" y2="-17.334" gradientTransform="matrix(90 0 0 -90 -49226 -1238.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#A61214" offset="0"/><stop stop-color="#D82023" offset="1"/></linearGradient><path d="m359.29 335.95v-83.676c0 6.973 223.14 20.919 223.14 55.784v83.677c0-34.865-223.14-48.811-223.14-55.785" fill="url(#path2572_1_)"/></g><g transform="matrix(.1059 0 0 .1059 -30.649 546.7)"><linearGradient id="path2592_1_" x1="550.94" x2="554.04" y1="-18.174" y2="-18.174" gradientTransform="matrix(90 0 0 -90 -49226 -1202.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#A61214" offset="0"/><stop stop-color="#D82023" offset="1"/></linearGradient><path d="m359.29 447.52v-83.677c0 6.973 223.14 20.92 223.14 55.785v83.676c0-34.866-223.14-48.812-223.14-55.784" fill="url(#path2592_1_)"/></g><g transform="matrix(.1059 0 0 .1059 -30.649 546.7)"><linearGradient id="path2712_1_" x1="550.94" x2="554.04" y1="-16.494" y2="-16.494" gradientTransform="matrix(90 0 0 -90 -49226 -1274.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#A61214" offset="0"/><stop stop-color="#D82023" offset="1"/></linearGradient><path d="m359.29 224.38v-83.677c0 6.973 223.14 20.92 223.14 55.784v83.677c0-34.865-223.14-48.811-223.14-55.784" fill="url(#path2712_1_)"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="40px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 36" version="1.1" height="36px">
|
||||
<defs>
|
||||
<linearGradient id="a" x2="50%" x1="50%" y2="100%">
|
||||
<stop stop-color="#F88A36" offset="0"/>
|
||||
<stop stop-color="#FD2020" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path d="m29.885 33.047c-4.667 2.696-11.084 2.973-17.54 0.206-5.2273-2.224-9.5646-6.117-12.345-10.565 1.3346 1.112 2.8916 2.002 4.5598 2.78 6.6672 3.125 13.333 2.911 18.024 0.008-0.003-0.003-0.005-0.005-0.007-0.008-6.673-5.116-12.345-11.789-16.571-17.238-0.8901-0.8898-1.5574-2.002-2.2247-3.0029 5.1159 4.671 13.235 10.565 16.126 12.234-6.116-6.451-11.566-14.458-11.344-14.236 9.676 9.787 18.685 15.348 18.685 15.348 0.298 0.168 0.528 0.308 0.713 0.433 0.195-0.496 0.366-1.011 0.51-1.545 1.557-5.672-0.222-12.123-4.115-17.461 9.008 5.4495 14.347 15.681 12.122 24.245-0.058 0.231-0.121 0.459-0.189 0.683 0.026 0.031 0.052 0.063 0.078 0.096 4.448 5.561 3.225 11.455 2.669 10.343-2.413-4.722-6.88-3.278-9.151-2.32z" fill="url(#a)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="408px" height="408px" viewBox="0 0 408 408" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 64 (93537) - https://sketch.com -->
|
||||
<title>矩形</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="CI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="子步骤状态" transform="translate(-3765.000000, -1220.000000)" fill-rule="nonzero">
|
||||
<g id="编组-21" transform="translate(3765.000000, 1220.000000)">
|
||||
<g id="资源-1" transform="translate(59.000000, 6.000000)">
|
||||
<polygon id="路径" fill="#000000" points="9.86 258.979338 9.86 264.595013 27.69 264.595013 27.69 310.448041 33.86 310.448041 33.86 264.595013 51.69 264.595013 51.69 258.979338"></polygon>
|
||||
<path d="M162.600098,300.992163 C162.602922,300.8445 162.517305,300.709318 162.382359,300.64853 C162.247414,300.587742 162.08913,300.613055 161.98,300.712875 C158.486262,303.659231 154.135693,305.407619 149.57,305.700153 C141.29,305.700153 135.94,300.164275 135.94,291.596132 C135.94,283.02799 141.29,277.482137 149.57,277.482137 C152.13,277.482137 157.79,278.200305 161.99,281.811094 C162.100984,281.905507 162.257223,281.92607 162.38896,281.8636 C162.520697,281.801131 162.603343,281.667289 162.600098,281.521832 L162.600098,275.896183 C158.574082,273.414902 153.969533,272.022614 149.24,271.856489 C137.81,271.856489 130.12,279.836132 130.12,291.636031 C130.12,303.435929 137.81,311.405598 149.24,311.405598 C154.005805,311.464668 158.672975,310.04996 162.600098,307.355929 L162.600098,300.992163 Z" id="路径" fill="#000000"></path>
|
||||
<path d="M81.94,299.775267 C81.9415062,299.614539 81.8385478,299.471323 81.6854452,299.421178 C81.5323427,299.371034 81.3643097,299.425494 81.27,299.555827 C78.52,303.156641 71.96,306.069211 67.93,306.069211 C64.08,306.069211 60.45,304.802443 58.47,302.757659 C56.0642711,300.227376 54.7469768,296.858385 54.8,293.371603 L83.66,293.371603 L83.66,292.932723 C83.66,284.813435 82.28,280.205191 78.72,276.514606 C75.72,273.422494 71.65,271.856489 66.55,271.856489 C55.75,271.856489 48.77,279.566819 48.77,291.516336 C49.17,303.944631 56.25,311.355725 67.71,311.355725 C72.9708836,311.398409 78.0536497,309.456696 81.94,305.919593 L81.94,299.775267 Z M77.83,288.085089 L54.83,288.085089 L54.83,287.965394 C55.2183231,281.904498 60.3017935,277.211182 66.39,277.292621 C73.11,277.292621 77.5,281.402137 77.82,288.015267 L77.83,288.085089 Z" id="形状" fill="#000000"></path>
|
||||
<path d="M107.92,271.856489 C103.2,271.856489 99.19,273.432468 96.51,276.325089 L96.51,272.7143 L90.68,272.7143 L90.68,310.517863 L96.68,310.517863 L96.68,288.972824 C96.68,285.421883 97.77,282.399593 99.75,280.464529 C101.87779,278.359934 104.8103,277.269853 107.8,277.472163 C112.47,277.611807 117.19,280.693944 117.19,287.267176 L117.19,310.477964 L123.19,310.477964 L123.19,287.027786 C123.19,282.369669 121.71,278.489567 118.9,275.806412 C115.904809,273.098035 111.958826,271.678515 107.92,271.856489 L107.92,271.856489 Z" id="路径" fill="#000000"></path>
|
||||
<path d="M201.54,299.775267 C201.534544,299.615728 201.429461,299.476697 201.277193,299.427559 C201.124924,299.378421 200.95811,299.429709 200.86,299.555827 C198.12,303.156641 191.56,306.069211 187.53,306.069211 C183.67,306.069211 180.05,304.802443 178.07,302.757659 C175.657868,300.230709 174.336453,296.860361 174.39,293.371603 L203.26,293.371603 L203.26,292.932723 C203.26,284.813435 201.87,280.205191 198.31,276.514606 C195.31,273.422494 191.25,271.856489 186.15,271.856489 C175.35,271.856489 168.37,279.566819 168.37,291.516336 C168.76,303.944631 175.84,311.355725 187.31,311.355725 C192.570884,311.398409 197.65365,309.456696 201.54,305.919593 L201.54,299.775267 Z M197.43,288.085089 L174.38,288.085089 L174.38,287.965394 C174.769312,281.881016 179.888753,277.178896 186,277.292621 C192.73,277.292621 197.11,281.402137 197.44,288.015267 L197.43,288.085089 Z" id="形状" fill="#000000"></path>
|
||||
<path d="M227.42,271.856489 C222.7,271.856489 218.69,273.432468 216.01,276.325089 L216.01,272.7143 L210.18,272.7143 L210.18,310.517863 L216.18,310.517863 L216.18,288.972824 C216.18,285.421883 217.27,282.399593 219.25,280.464529 C221.365949,278.373398 224.277294,277.284422 227.25,277.472163 C231.92,277.611807 236.64,280.693944 236.64,287.267176 L236.64,310.477964 L242.64,310.477964 L242.64,287.027786 C242.64,282.369669 241.16,278.489567 238.35,275.806412 C235.366188,273.112284 231.441441,271.693944 227.42,271.856489 L227.42,271.856489 Z" id="路径" fill="#000000"></path>
|
||||
<path d="M262.1,311.01659 C264.752334,310.771362 267.361123,310.181183 269.86,309.261069 L269.86,303.565598 C269.86,303.44641 269.802293,303.334559 269.705058,303.265283 C269.607824,303.196006 269.483033,303.177833 269.37,303.216489 C267.285785,303.953815 265.150024,304.537238 262.98,304.962036 C262.35,305.061781 261.81,305.151552 261.4,304.802443 C261.078204,304.492509 260.925614,304.04704 260.99,303.605496 L260.99,278.21028 L271.9,278.21028 L271.9,272.704326 L261,272.704326 L261,262.64 L254.8,262.64 L254.8,272.704326 L248.59,272.704326 L248.59,278.21028 L254.8,278.21028 L254.8,304.223919 C254.67187,306.147035 255.404207,308.028006 256.8,309.360814 C258.30623,310.536846 260.190306,311.125451 262.1,311.01659 Z" id="路径" fill="#000000"></path>
|
||||
<path d="M94.75,377.457099 C94.7579836,377.299566 94.6647125,377.154386 94.5178864,377.095805 C94.3710602,377.037224 94.2031394,377.078193 94.1,377.197761 C89.4165254,382.525687 82.6737991,385.603551 75.57,385.656183 C63.63,385.656183 55.93,377.427176 55.93,364.709618 C55.93,351.742697 63.27,343.683257 75.1,343.683257 C81.9768429,343.81517 88.5395976,346.579298 93.43,351.403562 C93.534689,351.515069 93.6974325,351.550715 93.8393274,351.493217 C93.9812224,351.435718 94.072935,351.296963 94.07,351.144224 L94.07,344.580967 C88.7903924,340.040322 82.0410497,337.560049 75.07,337.598332 C67.65,337.598332 61.36,340.182188 56.89,345.079695 C52.42,349.977201 50.12,356.710025 50.12,364.679695 C50.12,380.868397 60.34,391.760611 75.55,391.760611 C82.6072831,391.809123 89.4352359,389.263145 94.73,384.608855 L94.75,377.457099 Z" id="路径" fill="#000000"></path>
|
||||
<path d="M231.41,356.560407 C228.21,353.109211 222.88,351.862392 219.04,351.862392 C214.142993,351.748518 209.424203,353.696402 206.04,357.228702 C202.72,360.789618 200.96,365.736997 200.96,371.522239 C200.96,385.247226 210.1,391.391552 219.15,391.391552 C224.44,391.391552 228.8,389.506361 231.37,386.17486 L231.37,390.523766 L237.52,390.523766 L237.52,339.055064 L231.37,339.055064 L231.41,356.560407 Z M231.24,371.661883 C231.24,378.693944 227.15,385.805802 219.34,385.805802 C213.47,385.805802 207.15,381.46687 207.15,371.96112 C207.15,364.978931 210.85,357.448142 218.97,357.448142 C228,357.448142 231.24,365.068702 231.24,371.661883 Z" id="形状" fill="#000000"></path>
|
||||
<rect id="矩形" fill="#000000" x="102.92" y="339.055064" width="6.25" height="51.4587277"></rect>
|
||||
<path d="M187.86,371.96112 C187.86,382.204987 181.94,385.8457 176.86,385.8457 C171.94,385.8457 166.71,382.454351 166.71,376.160407 L166.71,352.740153 L160.84,352.740153 L160.84,376.040712 C160.84,385.067684 167.3,391.381578 176.56,391.381578 C181.69,391.381578 185.69,389.65598 188.23,386.3943 L188.23,390.513791 L193.83,390.513791 L193.83,352.740153 L187.83,352.740153 L187.86,371.96112 Z" id="路径" fill="#000000"></path>
|
||||
<path d="M135.71,351.932214 C124.71,351.932214 117.33,359.861985 117.33,371.661883 C117.33,383.461781 124.72,391.391552 135.71,391.391552 C146.7,391.391552 154.09,383.461781 154.09,371.661883 C154.09,359.861985 146.7,351.932214 135.71,351.932214 Z M123,371.621985 L123,371.621985 C123,363.253333 128.12,357.657608 135.68,357.657608 C143.24,357.657608 148.36,363.303206 148.36,371.691807 C148.36,380.080407 143.26,385.726005 135.68,385.726005 C128.1,385.726005 123,380.030534 123,371.621985 Z" id="形状" fill="#000000"></path>
|
||||
<path d="M273.69,96.2145547 C260.970259,83.2015251 243.520752,75.8639726 225.3,75.8664625 C208.87,75.8664625 194.72,81.5120611 182.37,91.5564377 C176.98,95.9252926 171.37,101.161934 164.23,108.044377 L58.37,210.463104 C64.7799695,211.19146 71.2288914,211.524578 77.68,211.46056 C83.85,211.46056 201.42,211.46056 206.34,211.46056 C216.25,211.46056 222.7,211.46056 229.62,210.951858 C245.5,209.794809 260.51,203.969669 272.62,192.099949 C285.532064,179.516901 292.898223,162.329189 293.095179,144.324509 C293.292136,126.319828 286.303726,108.975887 273.67,96.1148092 M254,173.218117 C248.78,178.374962 239.46,184.190127 224.18,184.748702 C217.12,184.988092 208.87,185.008041 205.09,185.008041 L123,185.008041 L181.9,127.953588 C184.61,125.33028 190.7,119.515115 195.95,114.79715 C207.48,104.443562 217.87,102.35888 225.21,102.418728 C242.031016,102.439436 257.164758,112.61703 263.491331,128.16331 C269.817905,143.709589 266.077561,161.528973 254.03,173.238066" id="形状" fill="#00A1FF"></path>
|
||||
<path d="M108.58,89.8408142 C96.58,80.863715 83.09,75.8764377 67.82,75.8764377 C40.2140733,75.9574907 15.3968291,92.6778459 5.01348954,118.191658 C-5.36985,143.70547 0.741557328,172.948864 20.48,192.199695 C30.7776083,202.2428 44.0823459,208.655834 58.37,210.463104 L84.72,184.968142 C80.45,184.968142 74.34,184.878372 68.91,184.708804 C53.64,184.180153 44.33,178.335064 39.11,173.188193 C27.0650269,161.481639 23.3234368,143.667105 29.6448761,128.122656 C35.9663154,112.578206 51.0926265,102.397656 67.91,102.368855 C75.13,102.368855 84.91,104.423613 95.97,113.57028 C101.25,117.939135 112.97,128.212926 118.11,132.84112 C118.2264,132.958072 118.384783,133.023847 118.55,133.023847 C118.715217,133.023847 118.8736,132.958072 118.99,132.84112 L137.14,115.186158 C137.291999,115.06502 137.3805,114.881494 137.3805,114.68743 C137.3805,114.493367 137.291999,114.30984 137.14,114.188702 C128.41,106.318779 116.05,95.3068702 108.6,89.7809669" id="路径" fill="#00C4D6"></path>
|
||||
<path d="M232.43,60.5455471 C218.513105,21.3349352 179.678777,-3.44192042 138.155364,0.396982225 C96.6319507,4.23588487 63.0246852,35.7100758 56.57,76.8040712 C60.2876467,76.1825044 64.0504894,75.868898 67.82,75.8664631 C72.993426,75.8524349 78.1499931,76.4551825 83.18,77.661883 L83.47,77.661883 C89.1701919,50.5078467 111.696216,30.0675628 139.335847,26.9687933 C166.975478,23.8700239 193.488629,38.8123653 205.09,64.0266667 C205.131779,64.1725921 205.230313,64.295801 205.363665,64.3688647 C205.497018,64.4419284 205.654121,64.4587822 205.8,64.4156743 C214.165555,62.1093392 222.85788,61.2092827 231.52,61.7524682 C232.38,61.8123155 232.71,61.3335369 232.43,60.5455471" id="路径" fill="#006EFF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1 @@
|
||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title"><title id="title">terraform-icon logo</title><path fill-rule="evenodd" clip-rule="evenodd" d="M16.664 7.384l10.468 6.042v12.085L16.664 19.47V7.384z" fill="#623CE4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M28.277 13.426v12.085l10.468-6.042V7.379l-10.468 6.047z" fill="#3C2AA8"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5.047.634v12.085l10.468 6.048V6.677L5.047.633zM16.664 32.878l10.463 6.048v-12.09l-10.463-6.043v12.085z" fill="#623CE4"/></svg>
|
||||
|
After Width: | Height: | Size: 593 B |
@@ -0,0 +1,42 @@
|
||||
import { spawn } from "child_process";
|
||||
|
||||
export class ExecResult {
|
||||
stdout = "";
|
||||
exitCode = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a process
|
||||
*/
|
||||
export async function exec(
|
||||
command: string,
|
||||
args: string[] = [],
|
||||
allowAllExitCodes: boolean = false
|
||||
): Promise<ExecResult> {
|
||||
process.stdout.write(`EXEC: ${command} ${args.join(" ")}\n`);
|
||||
return new Promise((resolve, reject) => {
|
||||
const execResult = new ExecResult();
|
||||
const cp = spawn(command, args, {});
|
||||
|
||||
// STDOUT
|
||||
cp.stdout.on("data", (data) => {
|
||||
process.stdout.write(data);
|
||||
execResult.stdout += data.toString();
|
||||
});
|
||||
|
||||
// STDERR
|
||||
cp.stderr.on("data", (data) => {
|
||||
process.stderr.write(data);
|
||||
});
|
||||
|
||||
// Close
|
||||
cp.on("close", (code) => {
|
||||
execResult.exitCode = code;
|
||||
if (code === 0 || allowAllExitCodes) {
|
||||
resolve(execResult);
|
||||
} else {
|
||||
reject(new Error(`Command exited with code ${code}`));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
#!/usr/bin/env npx ts-node
|
||||
import { promises as fs } from "fs";
|
||||
import { safeLoad } from "js-yaml";
|
||||
import { basename, extname, join } from "path";
|
||||
import { exec } from "./exec";
|
||||
|
||||
interface WorkflowDesc {
|
||||
folder: string;
|
||||
id: string;
|
||||
iconName?: string;
|
||||
iconType?: "svg" | "octicon";
|
||||
}
|
||||
|
||||
interface WorkflowsCheckResult {
|
||||
compatibleWorkflows: WorkflowDesc[];
|
||||
incompatibleWorkflows: WorkflowDesc[];
|
||||
}
|
||||
|
||||
async function checkWorkflows(
|
||||
folders: string[],
|
||||
enabledActions: string[]
|
||||
): Promise<WorkflowsCheckResult> {
|
||||
const result: WorkflowsCheckResult = {
|
||||
compatibleWorkflows: [],
|
||||
incompatibleWorkflows: [],
|
||||
};
|
||||
|
||||
for (const folder of folders) {
|
||||
const dir = await fs.readdir(folder, {
|
||||
withFileTypes: true,
|
||||
});
|
||||
|
||||
for (const e of dir) {
|
||||
if (e.isFile()) {
|
||||
const workflowFilePath = join(folder, e.name);
|
||||
const enabled = await checkWorkflow(workflowFilePath, enabledActions);
|
||||
|
||||
const workflowId = basename(e.name, extname(e.name));
|
||||
const workflowProperties = require(join(
|
||||
folder,
|
||||
"properties",
|
||||
`${workflowId}.properties.json`
|
||||
));
|
||||
const iconName: string | undefined = workflowProperties["iconName"];
|
||||
|
||||
const workflowDesc: WorkflowDesc = {
|
||||
folder,
|
||||
id: workflowId,
|
||||
iconName,
|
||||
iconType:
|
||||
iconName && iconName.startsWith("octicon") ? "octicon" : "svg",
|
||||
};
|
||||
|
||||
if (!enabled) {
|
||||
result.incompatibleWorkflows.push(workflowDesc);
|
||||
} else {
|
||||
result.compatibleWorkflows.push(workflowDesc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a workflow uses only the given set of actions.
|
||||
*
|
||||
* @param workflowPath Path to workflow yaml file
|
||||
* @param enabledActions List of enabled actions
|
||||
*/
|
||||
async function checkWorkflow(
|
||||
workflowPath: string,
|
||||
enabledActions: string[]
|
||||
): Promise<boolean> {
|
||||
// Create set with lowercase action names for easier, case-insensitive lookup
|
||||
const enabledActionsSet = new Set(enabledActions.map((x) => x.toLowerCase()));
|
||||
|
||||
try {
|
||||
const workflowFileContent = await fs.readFile(workflowPath, "utf8");
|
||||
const workflow = safeLoad(workflowFileContent);
|
||||
|
||||
for (const job of Object.keys(workflow.jobs || {}).map(
|
||||
(k) => workflow.jobs[k]
|
||||
)) {
|
||||
for (const step of job.steps || []) {
|
||||
if (!!step.uses) {
|
||||
// Check if allowed action
|
||||
const [actionName, _] = step.uses.split("@");
|
||||
if (!enabledActionsSet.has(actionName.toLowerCase())) {
|
||||
console.info(
|
||||
`Workflow ${workflowPath} uses '${actionName}' which is not supported for GHES.`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// All used actions are enabled 🎉
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.error("Error while checking workflow", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
(async function main() {
|
||||
try {
|
||||
const settings = require("./settings.json");
|
||||
|
||||
const result = await checkWorkflows(
|
||||
settings.folders,
|
||||
settings.enabledActions
|
||||
);
|
||||
|
||||
console.group(
|
||||
`Found ${result.compatibleWorkflows.length} starter workflows compatible with GHES:`
|
||||
);
|
||||
console.log(
|
||||
result.compatibleWorkflows.map((x) => `${x.folder}/${x.id}`).join("\n")
|
||||
);
|
||||
console.groupEnd();
|
||||
|
||||
console.group(
|
||||
`Ignored ${result.incompatibleWorkflows.length} starter-workflows incompatible with GHES:`
|
||||
);
|
||||
console.log(
|
||||
result.incompatibleWorkflows.map((x) => `${x.folder}/${x.id}`).join("\n")
|
||||
);
|
||||
console.groupEnd();
|
||||
|
||||
console.log("Switch to GHES branch");
|
||||
await exec("git", ["checkout", "ghes"]);
|
||||
|
||||
// In order to sync from master, we might need to remove some workflows, add some
|
||||
// and modify others. The lazy approach is to delete all workflows first, and then
|
||||
// just bring the compatible ones over from the master branch. We let git figure out
|
||||
// whether it's a deletion, add, or modify and commit the new state.
|
||||
console.log("Remove all workflows");
|
||||
await exec("rm", ["-fr", ...settings.folders]);
|
||||
await exec("rm", ["-fr", "../../icons"]);
|
||||
|
||||
console.log("Sync changes from master for compatible workflows");
|
||||
await exec("git", [
|
||||
"checkout",
|
||||
"master",
|
||||
"--",
|
||||
...Array.prototype.concat.apply(
|
||||
[],
|
||||
result.compatibleWorkflows.map((x) => {
|
||||
const r = [
|
||||
join(x.folder, `${x.id}.yml`),
|
||||
join(x.folder, "properties", `${x.id}.properties.json`),
|
||||
];
|
||||
|
||||
if (x.iconType === "svg") {
|
||||
r.push(join("../../icons", `${x.iconName}.svg`));
|
||||
}
|
||||
|
||||
return r;
|
||||
})
|
||||
),
|
||||
]);
|
||||
} catch (e) {
|
||||
console.error("Unhandled error while syncing workflows", e);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"name": "sync-ghes-actions",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@types/js-yaml": {
|
||||
"version": "3.12.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-3.12.4.tgz",
|
||||
"integrity": "sha512-fYMgzN+9e28R81weVN49inn/u798ruU91En1ZnGvSZzCRc5jXx9B2EDhlRaWmcO1RIxFHL8AajRXzxDuJu93+A==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz",
|
||||
"integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==",
|
||||
"dev": true
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"requires": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"buffer-from": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true
|
||||
},
|
||||
"esprima": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "3.13.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
|
||||
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
|
||||
"requires": {
|
||||
"argparse": "^1.0.7",
|
||||
"esprima": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.19",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
|
||||
"integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
}
|
||||
},
|
||||
"sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.10.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.1.tgz",
|
||||
"integrity": "sha512-bdNz1L4ekHiJul6SHtZWs1ujEKERJnHs4HxN7rjTyyVOFf3HaJ6sLqe6aPG62XTzAB/63pKRh5jTSWL0D7bsvw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.17",
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.9.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz",
|
||||
"integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==",
|
||||
"dev": true
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "sync-ghes-actions",
|
||||
"version": "1.0.0",
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "github/c2c-actions-experience",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^3.12.4",
|
||||
"@types/node": "^14.0.1",
|
||||
"ts-node": "^8.10.1",
|
||||
"typescript": "^3.9.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"js-yaml": "^3.13.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"folders": [
|
||||
"../../ci",
|
||||
"../../automation"
|
||||
],
|
||||
"enabledActions": [
|
||||
"actions/checkout",
|
||||
"actions/create-release",
|
||||
"actions/delete-package-versions",
|
||||
"actions/download-artifact",
|
||||
"actions/setup-dotnet",
|
||||
"actions/setup-go",
|
||||
"actions/setup-java",
|
||||
"actions/setup-node",
|
||||
"actions/stale",
|
||||
"actions/starter-workflows",
|
||||
"actions/upload-artifact",
|
||||
"actions/upload-release-asset"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
},
|
||||
"include": ["*.ts"]
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
#!/usr/bin/env npx ts-node
|
||||
import { promises as fs } from "fs";
|
||||
import { safeLoad } from "js-yaml";
|
||||
import { basename, extname, join } from "path";
|
||||
import { Validator as validator } from "jsonschema";
|
||||
import { endGroup, error, info, setFailed, startGroup } from '@actions/core';
|
||||
|
||||
interface WorkflowWithErrors {
|
||||
id: string;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
interface WorkflowProperties {
|
||||
name: string;
|
||||
description: string;
|
||||
iconName: string;
|
||||
categories: string[];
|
||||
}
|
||||
|
||||
const propertiesSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
name: { type: "string", required: true },
|
||||
description: { type: "string", required: true },
|
||||
iconName: { type: "string", required: true },
|
||||
categories: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "array",
|
||||
items: { type: "string" }
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
}
|
||||
],
|
||||
required: true
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
async function checkWorkflows(folders: string[]): Promise<WorkflowWithErrors[]> {
|
||||
const result: WorkflowWithErrors[] = []
|
||||
|
||||
for (const folder of folders) {
|
||||
const dir = await fs.readdir(folder, {
|
||||
withFileTypes: true,
|
||||
});
|
||||
|
||||
for (const e of dir) {
|
||||
if (e.isFile()) {
|
||||
const fileType = basename(e.name, extname(e.name))
|
||||
|
||||
const workflowFilePath = join(folder, e.name);
|
||||
const propertiesFilePath = join(folder, "properties", `${fileType}.properties.json`)
|
||||
|
||||
const errors = await checkWorkflow(workflowFilePath, propertiesFilePath);
|
||||
if (errors.errors.length > 0) {
|
||||
result.push(errors)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async function checkWorkflow(workflowPath: string, propertiesPath: string): Promise<WorkflowWithErrors> {
|
||||
let workflowErrors: WorkflowWithErrors = {
|
||||
id: workflowPath,
|
||||
errors: []
|
||||
}
|
||||
|
||||
try {
|
||||
const workflowFileContent = await fs.readFile(workflowPath, "utf8");
|
||||
safeLoad(workflowFileContent); // Validate yaml parses without error
|
||||
|
||||
const propertiesFileContent = await fs.readFile(propertiesPath, "utf8")
|
||||
const properties: WorkflowProperties = JSON.parse(propertiesFileContent)
|
||||
|
||||
let v = new validator();
|
||||
const res = v.validate(properties, propertiesSchema)
|
||||
workflowErrors.errors = res.errors.map(e => e.toString())
|
||||
|
||||
if (properties.iconName && !properties.iconName.startsWith("octicon")) {
|
||||
try {
|
||||
await fs.access(`../../icons/${properties.iconName}.svg`)
|
||||
} catch (e) {
|
||||
workflowErrors.errors.push(`No icon named ${properties.iconName} found`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
workflowErrors.errors.push(e.toString())
|
||||
}
|
||||
return workflowErrors;
|
||||
}
|
||||
|
||||
(async function main() {
|
||||
try {
|
||||
const settings = require("./settings.json");
|
||||
const erroredWorkflows = await checkWorkflows(
|
||||
settings.folders
|
||||
)
|
||||
|
||||
if (erroredWorkflows.length > 0) {
|
||||
startGroup(`😟 - Found ${erroredWorkflows.length} workflows with errors:`);
|
||||
erroredWorkflows.forEach(erroredWorkflow => {
|
||||
error(`Errors in ${erroredWorkflow.id} - ${erroredWorkflow.errors.map(e => e.toString()).join(", ")}`)
|
||||
})
|
||||
endGroup();
|
||||
setFailed(`Found ${erroredWorkflows.length} workflows with errors`);
|
||||
} else {
|
||||
info("🎉🤘 - Found no workflows with errors!")
|
||||
}
|
||||
} catch (e) {
|
||||
error(`Unhandled error while syncing workflows: ${e}`);
|
||||
setFailed(`Unhandled error`)
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"name": "sync-ghes-actions",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@actions/core": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz",
|
||||
"integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg=="
|
||||
},
|
||||
"@types/js-yaml": {
|
||||
"version": "3.12.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-3.12.4.tgz",
|
||||
"integrity": "sha512-fYMgzN+9e28R81weVN49inn/u798ruU91En1ZnGvSZzCRc5jXx9B2EDhlRaWmcO1RIxFHL8AajRXzxDuJu93+A==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz",
|
||||
"integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==",
|
||||
"dev": true
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"requires": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"buffer-from": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true
|
||||
},
|
||||
"esprima": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "3.13.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
|
||||
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
|
||||
"requires": {
|
||||
"argparse": "^1.0.7",
|
||||
"esprima": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"jsonschema": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.6.tgz",
|
||||
"integrity": "sha512-SqhURKZG07JyKKeo/ir24QnS4/BV7a6gQy93bUSe4lUdNp0QNpIz2c9elWJQ9dpc5cQYY6cvCzgRwy0MQCLyqA=="
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.19",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
|
||||
"integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
}
|
||||
},
|
||||
"sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.10.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.1.tgz",
|
||||
"integrity": "sha512-bdNz1L4ekHiJul6SHtZWs1ujEKERJnHs4HxN7rjTyyVOFf3HaJ6sLqe6aPG62XTzAB/63pKRh5jTSWL0D7bsvw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.17",
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.9.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz",
|
||||
"integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==",
|
||||
"dev": true
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "validate-data",
|
||||
"version": "1.0.0",
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "github/c2c-actions-experience",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^3.12.4",
|
||||
"@types/node": "^14.0.1",
|
||||
"ts-node": "^8.10.1",
|
||||
"typescript": "^3.9.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.4",
|
||||
"js-yaml": "^3.13.1",
|
||||
"jsonschema": "^1.2.6"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"folders": [
|
||||
"../../ci",
|
||||
"../../automation"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
},
|
||||
"include": ["*.ts"]
|
||||
}
|
||||