Skip to content

Commit

Permalink
Update Formula
Browse files Browse the repository at this point in the history
  • Loading branch information
ivancorrales committed Mar 6, 2022
1 parent d75394b commit d1da952
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 92 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
schedule:
- cron: '11 0 * * 5'
- cron: "0 0 * * 0"

jobs:
analyze:
Expand All @@ -15,15 +15,19 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'go','javascript' ]
language: ["go", "javascript"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
queries: security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
42 changes: 28 additions & 14 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Development

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

jobs:
Expand All @@ -14,7 +14,8 @@ jobs:
run:
working-directory: cmd/client/templatizer-ui
steps:
- uses: actions/checkout@v1
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: 14
Expand All @@ -24,42 +25,55 @@ jobs:
with:
name: templatizer-ui-build
path: cmd/client/templatizer-ui/build

linters:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
- name: hadolint
uses: hadolint/hadolint-action@v1.6.0
with:
dockerfile: Dockerfile

tests:
runs-on: ubuntu-latest
needs:
- buildFrontend
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code
uses: actions/checkout@v3

- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go
key: ${{ runner.os }}-build-${{ hashFiles('go.mod') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/download-artifact@v2
with:
name: templatizer-ui-build
path: cmd/client/templatizer-ui/build
- name: Configure go version

- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Clean repository
run: make clean install

- name: Run unit tests
run: make test

- name: Upload coverage
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage.*

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0
with:
Expand All @@ -69,7 +83,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04 ] # , macos-10.15, windows-2019 ]
os: [ubuntu-20.04] # , macos-10.15, windows-2019 ]
runs-on: ${{ matrix.os }}
needs:
- linters
Expand All @@ -78,13 +92,13 @@ jobs:
run:
shell: bash
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code
uses: actions/checkout@v3
- uses: actions/download-artifact@v2
with:
name: templatizer-ui-build
path: cmd/client/templatizer-ui/build
- name: Configure go version
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/issueauto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Issue Automation
on:
issues:
types: [opened]
jobs:
issue-auto:
runs-on: ubuntu-latest
steps:
- name: label incoming issue
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
ISSUENUM: ${{ github.event.issue.number }}
ISSUEAUTHOR: ${{ github.event.issue.user.login }}
run: |
if ! gh api orgs/cli/public_members/$ISSUEAUTHOR --silent 2>/dev/null
then
gh issue edit $ISSUENUM --add-label "needs-triage"
fi
75 changes: 75 additions & 0 deletions .github/workflows/prauto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: PR Automation
on:
pull_request_target:
types: [ready_for_review, opened, reopened]
jobs:
pr-auto:
runs-on: ubuntu-latest
steps:
- name: lint pr
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
PRID: ${{ github.event.pull_request.node_id }}
PRBODY: ${{ github.event.pull_request.body }}
PRNUM: ${{ github.event.pull_request.number }}
PRHEAD: ${{ github.event.pull_request.head.label }}
PRAUTHOR: ${{ github.event.pull_request.user.login }}
PR_AUTHOR_TYPE: ${{ github.event.pull_request.user.type }}
if: "!github.event.pull_request.draft"
run: |
commentPR () {
gh pr comment $PRNUM -b "${1}"
}
closePR () {
gh pr close $PRNUM
}
colID () {
gh api graphql -f query='query($owner:String!, $repo:String!) {
repository(owner:$owner, name:$repo) {
project(number:1) {
columns(first:10) { nodes {id,name} }
}
}
}' -f owner="${GH_REPO%/*}" -f repo="${GH_REPO#*/}" \
-q ".data.repository.project.columns.nodes[] | select(.name | startswith(\"$1\")) | .id"
}
addToBoard () {
gh api graphql --silent -f query='
mutation($colID:ID!, $prID:ID!) { addProjectCard(input: { projectColumnId: $colID, contentId: $prID }) { clientMutationId } }
' -f colID="$(colID "Needs review")" -f prID="$PRID"
}
if [ "$PR_AUTHOR_TYPE" = "Bot" ] || gh api orgs/cli/public_members/$PRAUTHOR --silent 2>/dev/null
then
if [ "$PR_AUTHOR_TYPE" != "Bot" ]
then
gh pr edit $PRNUM --add-assignee $PRAUTHOR
fi
if ! errtext="$(addToBoard 2>&1)"
then
cat <<<"$errtext" >&2
if ! grep -iq 'project already has the associated issue' <<<"$errtext"
then
exit 1
fi
fi
exit 0
fi
gh pr edit $PRNUM --add-label "external"
if [ "$PRHEAD" = "cli:trunk" ]
then
closePR
exit 0
fi
if [ $(wc -c <<<"$PRBODY") -lt 10 ]
then
commentPR "Thanks for the pull request! We're a small team and it's helpful to have context around community submissions in order to review them appropriately. Our automation has closed this pull request since it does not have an adequate description. Please edit the body of this pull request to describe what this does, then reopen it."
closePR
exit 0
fi
if ! grep -Eq '(#|issues/)[0-9]+' <<<"$PRBODY"
then
commentPR "Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message."
fi
addToBoard
exit 0
76 changes: 25 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@ jobs:
run:
working-directory: cmd/client/templatizer-ui
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: Check out code
uses: actions/checkout@v3

- name: Setup node version 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn install
- run: yarn build
- uses: actions/upload-artifact@v2

- name: Install dependencies
run: yarn install

- name: Build and minimize code
run: yarn build

- name: Save created files
uses: actions/upload-artifact@v2
with:
name: templatizer-ui-build
path: cmd/client/templatizer-ui/build
Expand All @@ -28,25 +37,26 @@ jobs:
needs:
- buildFrontend
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- name: Check out code
uses: actions/checkout@v3

- name: Download created content in previous steps
uses: actions/download-artifact@v2
with:
name: templatizer-ui-build
path: cmd/client/templatizer-ui/build
- uses: actions/setup-go@v2

- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Install Go project
run: make install

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaserw/goreleaser-action@v2
with:
Expand All @@ -56,39 +66,3 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURYPUSHTOKEN }}
msi:
needs: goreleaser
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go 1.13
id: go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Download gh.exe
uses: ./.github/actions/download-exe
id: download_exe
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install go-msi
run: choco install -y "go-msi"
- name: Build MSI
id: buildmsi
uses: ./.github/actions/build-msi
with:
exe: ${{ steps.download_exe.outputs.exe }}
- name: Obtain signing cert
env:
DESKTOP_CERT_TOKEN: ${{ secrets.DESKTOP_CERT_TOKEN }}
run: .\setup-windows-certificate.ps1
shell: powershell
- name: Sign MSI
env:
GITHUB_CERT_PASSWORD: ${{ secrets.GITHUB_CERT_PASSWORD }}
run: .\sign.ps1 -Certificate "windows-certificate.pfx" -Executable "${{ steps.buildmsi.outputs.msi }}"
- name: Upload MSI
uses: ./.github/actions/upload-msi
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 0 additions & 3 deletions Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/setup.sh

This file was deleted.

0 comments on commit d1da952

Please sign in to comment.