Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-cup committed Aug 27, 2021
0 parents commit 399b084
Show file tree
Hide file tree
Showing 27 changed files with 2,138 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/.syncignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CODEOWNERS
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
27 changes: 27 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- name: status/possible-priority
description: This issue is ready to work and should be considered as a potential priority
color: F9D0C4
- name: status/prioritized
description: This issue has been triaged and resolving it is a priority
color: BFD4F2
- name: status/blocked
description: This issue has been triaged and resolving it is blocked on some other issue
color: 848978
- name: bug
description: Something isn't working
color: d73a4a
- name: enhancement
description: A new feature or request
color: a2eeef
- name: documentation
description: This issue relates to writing documentation
color: D4C5F9
- name: semver:major
description: A change requiring a major version bump
color: 6b230e
- name: semver:minor
description: A change requiring a minor version bump
color: cc6749
- name: semver:patch
description: A change requiring a patch version bump
color: f9d0c4
35 changes: 35 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * *' # Once a day at midnight

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

strategy:
fail-fast: false
matrix:
language:
- 'go'

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
73 changes: 73 additions & 0 deletions .github/workflows/create-draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Create or Update Draft Release

on:
push:
branches:
- main
repository_dispatch:
types: [ version-bump ]
workflow_dispatch: {}

concurrency: release

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:

- name: Setup Go
uses: actions/[email protected]
with:
go-version: 1.17.x

- name: Checkout
uses: actions/checkout@v2

- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true

- name: Reset Draft Release
id: reset
uses: paketo-buildpacks/github-config/actions/release/reset-draft@main
with:
repo: ${{ github.repository }}
token: ${{ github.token }}

- name: Tag
id: tag
uses: paketo-buildpacks/github-config/actions/tag/increment-tag@main
with:
current_version: ${{ steps.reset.outputs.current_version }}

- name: Package
run: ./scripts/package.sh --version "${{ steps.tag.outputs.tag }}"
- name: Create Release Notes
id: create-release-notes
uses: paketo-buildpacks/github-config/actions/release/notes@main
with:
repo: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: paketo-buildpacks/github-config/actions/release/create@main
with:
repo: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ steps.tag.outputs.tag }}
target_commitish: ${{ github.sha }}
name: v${{ steps.tag.outputs.tag }}
body: ${{ steps.create-release-notes.outputs.release_body }}
draft: true
assets: |
[
{
"path": "build/buildpack.tgz",
"name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.tgz",
"content_type": "application/gzip"
},
{
"path": "build/buildpackage.cnb",
"name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb",
"content_type": "application/gzip"
}
]
30 changes: 30 additions & 0 deletions .github/workflows/lint-yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint Workflows

on:
pull_request:
paths:
- '.github/**.yml'
- '.github/**.yaml'

jobs:
lintYaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Checkout github-config
uses: actions/checkout@v2
with:
repository: paketo-buildpacks/github-config
path: github-config

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install yamllint
run: pip install yamllint

- name: Lint YAML files
run: yamllint ./.github -c github-config/.github/.yamllint
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.32.2
53 changes: 53 additions & 0 deletions .github/workflows/push-buildpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Push Buildpackage

on:
release:
types:
- published

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
push:
name: Push
runs-on: ubuntu-latest
steps:

- name: Parse Event
id: event
run: |
echo "::set-output name=tag::$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)"
echo "::set-output name=download_url::$(jq -r '.release.assets[] | select(.name | endswith(".cnb")) | .url' "${GITHUB_EVENT_PATH}")"
- name: Download
id: download
uses: paketo-buildpacks/github-config/actions/release/download-asset@main
with:
url: ${{ steps.event.outputs.download_url }}
output: "/github/workspace/buildpackage.cnb"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Validate version
run: |
buidpackTomlVersion=$(sudo skopeo inspect "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" | jq -r '.Labels."io.buildpacks.buildpackage.metadata" | fromjson | .version')
githubReleaseVersion="${{ steps.event.outputs.tag }}"
if [[ "$buidpackTomlVersion" != "$githubReleaseVersion" ]]; then
echo "Version in buildpack.toml ($buidpackTomlVersion) and github release ($githubReleaseVersion) are not identical"
exit 1
fi
- name: Push to GitHub Registry
id: push
env:
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
run: |
IMAGE="${REGISTRY}/${REPOSITORY}"
echo "${PASSWORD}" | sudo skopeo login --username "${USERNAME}" --password-stdin ${REGISTRY}
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${IMAGE}:${{ steps.event.outputs.tag }}"
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${IMAGE}:latest"
echo "::set-output name=image::${IMAGE}"
echo "::set-output name=digest::$(sudo skopeo inspect "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" | jq -r .Digest)"
16 changes: 16 additions & 0 deletions .github/workflows/synchronize-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Synchronize Labels
"on":
push:
branches:
- main
paths:
- .github/labels.yml
jobs:
synchronize:
name: Synchronize Labels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: micnncim/action-label-syncer@v1
env:
GITHUB_TOKEN: ${{ github.token }}
44 changes: 44 additions & 0 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update dependencies

on:
schedule:
- cron: '*/15 * * * *'
workflow_dispatch: {}

jobs:
update-dependencies:
runs-on: ubuntu-latest
name: Update dependencies
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Checkout Branch
uses: paketo-buildpacks/github-config/actions/pull-request/checkout-branch@main
with:
branch: automation/dependencies/update

- name: Update dependencies
uses: paketo-buildpacks/github-config/actions/dependency/update@main

- name: Commit
id: commit
uses: paketo-buildpacks/github-config/actions/pull-request/create-commit@main
with:
message: "Updating dependencies in buildpack.toml"
pathspec: "."

- name: Push Branch
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: paketo-buildpacks/github-config/actions/pull-request/push-branch@main
with:
branch: automation/dependencies/update

- name: Open Pull Request
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: paketo-buildpacks/github-config/actions/pull-request/open@main
with:
token: ${{ secrets.GH_PAT }}
title: "Updates dependencies in buildpack.toml"
branch: automation/dependencies/update
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.bin
.DS_STORE
build
Empty file added .packit
Empty file.
Loading

0 comments on commit 399b084

Please sign in to comment.