Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] chore: Add workflows, update README #4

Merged
merged 15 commits into from
Apr 7, 2021
Merged
43 changes: 43 additions & 0 deletions .github/release_drafter_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

change-template: '- $TITLE (#$NUMBER)'

# Only add to the draft release when a PR has one of these labels
include-labels:
- 'Type: Major'
- 'Type: Minor'
- 'Type: Patch'
- 'Type: Chore'

# Here is how we determine what version the release would be, by using labels. Eg when "minor" is used, the drafter knows to bump up to a new minor version
version-resolver:
major:
labels:
- 'Type: Major'
minor:
labels:
- 'Type: Minor'
patch:
labels:
- 'Type: Patch'
- 'Type: Chore' # allow our chore PR's to just be patches too
default: patch

# What our release will look like. If no draft has been created, then this will be used, otherwise $CHANGES just gets addedd
template: |
__Compatibility__

* Requires Deno v<DENO_VERSION> or higher
* Uses Deno std@<STD_VERSION>

__Importing__

* Import this latest release by using the following in your project(s):
```typescript
import { Drash } from "https://deno.land/x/drash@v$RESOLVED_VERSION/mod.ts";
```

__Updates__

$CHANGES
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '18 8 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
6 changes: 4 additions & 2 deletions .github/workflows/ci.yaml → .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous Integration
name: Master

on:
pull_request:
Expand Down Expand Up @@ -31,7 +31,8 @@ jobs:
uses: denolib/setup-deno@master

- name: Lint code
run: deno fmt --check src/
run: deno fmt --check

tests_deno:
strategy:
fail-fast: true
Expand All @@ -46,6 +47,7 @@ jobs:

- name: Unit Test
run: deno test tests/deno/

tests_node:
strategy:
fail-fast: true
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pre-release

on:
create

jobs:

# Make a PR to master from a new branch with changes, and delete the created one
pre-release:

# Only run when a release-v* branch is created, and not by drashbot
if: contains(github.ref, 'release-v') && !contains(github.event.sender.login, 'drashbot')

runs-on: ubuntu-latest

steps:
- name: Notify the castle about this pre-release
run: |
curl -X POST \
-u "${{ secrets.CI_USER_NAME }}:${{ secrets.CI_USER_PAT }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
--data '{"event_type": "pre_release", "client_payload": { "repo": "moogle", "module": "moogle", "version": "${{ github.ref }}" }}' \
https://api.github.com/repos/drashland/castle/dispatches
43 changes: 43 additions & 0 deletions .github/workflows/project_issue_automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Project issue automation
on:
issues:
types:
- opened
- closed
- reopened
- assigned
- unassigned
jobs:
manage-cards:
runs-on: ubuntu-latest
steps:
- if: github.event.action == 'opened'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: To Do
repo-token: ${{ secrets.CI_USER_PAT }}
- if: github.event.action == 'closed'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: Done
repo-token: ${{ secrets.CI_USER_PAT }}
- if: github.event.action == 'reopened'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: In Progress Issues
repo-token: ${{ secrets.CI_USER_PAT }}
- if: github.event.action == 'assigned'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: In Progress Issues
repo-token: ${{ secrets.CI_USER_PAT }}
- if: github.event.action == 'unassigned'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: To Do
repo-token: ${{ secrets.CI_USER_PAT }}
38 changes: 38 additions & 0 deletions .github/workflows/project_pull_request_automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Project pull request automation
on:
pull_request:
branches:
- master
types:
- opened
- closed
- reopened
- review_requested
jobs:
manage-cards:
runs-on: ubuntu-latest
steps:
- if: github.event.action == 'opened'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: In Progress Pull Requests
repo-token: ${{ secrets.CI_USER_PAT }}
- if: github.event.action == 'closed'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: Done
repo-token: ${{ secrets.CI_USER_PAT }}
- if: github.event.action == 'reopened'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: In Progress Pull Requests
repo-token: ${{ secrets.CI_USER_PAT }}
- if: github.event.action == 'review_requested'
uses: alex-page/github-project-automation-plus@v0.2.4
with:
project: The Omnipresent Drash Land Project
column: Review In Progress
repo-token: ${{ secrets.CI_USER_PAT }}
24 changes: 16 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
release:
types:
- created
- published

jobs:
npm:
Expand All @@ -12,8 +12,6 @@ jobs:
- uses: actions/checkout@v2
with:
token: ${{ secrets.CI_USER_PAT }}
- id: get_version
uses: battila7/get-version-action@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
Expand All @@ -23,9 +21,8 @@ jobs:
run: yarn install
- name: Build
run: yarn build

- name: Publish
run: yarn publish --access public --new-version ${{ steps.get_version.outputs.version-without-v }}
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}

Expand All @@ -35,8 +32,6 @@ jobs:
- uses: actions/checkout@v2
with:
token: ${{ secrets.CI_USER_PAT }}
- id: get_version
uses: battila7/get-version-action@v2
# Setup .npmrc file to publish to github
- uses: actions/setup-node@v2
with:
Expand All @@ -47,6 +42,19 @@ jobs:
- name: Build
run: yarn build
- name: Publish
run: yarn publish --access public --new-version ${{ steps.get_version.outputs.version-without-v }}
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-egg:
runs-on: ubuntu-latest
steps:
- name: Notify the castle about this release
run: |
curl -X POST \
-u "${{ secrets.CI_USER_NAME }}:${{ secrets.CI_USER_PAT }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
--data '{"event_type": "release", "client_payload": { "repo": "moogle", "module": "moogle", "version": "${{ github.ref }}" }}' \
https://api.github.com/repos/drashland/castle/dispatches

19 changes: 19 additions & 0 deletions .github/workflows/release_drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: release_drafter_config.yml
env:
GITHUB_TOKEN: ${{ secrets.CI_USER_PAT }}
Loading