Skip to content

Commit

Permalink
Merge pull request #122 from open-sauced/beta
Browse files Browse the repository at this point in the history
chore: release 1.2.0
  • Loading branch information
jpmcb authored Aug 30, 2024
2 parents 06dbb1c + 2bb8e4b commit 6542f22
Show file tree
Hide file tree
Showing 51 changed files with 1,983 additions and 1,965 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 🐛 Bug report
description: Create a bug report to help us improve the OpenSauced CLI 🍕
title: "Bug: "
labels: [👀 needs triage, 🐛 bug, pizza-cli]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Describe how to reproduce the behavior.
validations:
required: true
- type: markdown
attributes:
value: |
Please include the following
1. System settings
2. Operating system version and special configurations
3. Shell environment (`echo $SHELL`) and version
4. `pizza version` output
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: ❓ Ask a question
url: https://github.com/orgs/open-sauced/discussions
about: Ask questions about OpenSauced
- name: 🪿 Security
url: mailto:security@opensauced.pizza
about: Contact us about security concerns
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 🚀 Feature request
description: Suggest an idea for the Pizza CLI 💡
title: "Feature: "
labels: [👀 needs triage, 💡 feature, pizza-cli]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
attributes:
label: Suggested solution
description: Describe the solution you'd like.
24 changes: 24 additions & 0 deletions .github/workflows/auto-add-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Adds issues to Team Dashboard"

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.OS_GITHUB_APP_ID }}
private_key: ${{ secrets.OS_GITHUB_APP_PRIVATE_KEY }}

- name: add issue to team dashboard
uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/open-sauced/projects/25
github-token: ${{ steps.generate_token.outputs.token }}
79 changes: 58 additions & 21 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Semantic release
name: "Semantic release"

on:
push:
Expand All @@ -7,27 +7,37 @@ on:
- beta
workflow_dispatch:

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test, lint, & build
uses: ./.github/workflows/test.yaml

release:
outputs:
release-tag: ${{ steps.semantic-release.outputs.release-tag }}
name: Semantic release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.OS_GITHUB_APP_ID }}
private_key: ${{ secrets.OS_GITHUB_APP_PRIVATE_KEY }}

- name: "☁️ checkout repository"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}

- name: "🔧 setup node"
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

Expand All @@ -36,47 +46,74 @@ jobs:

- name: "🚀 release"
id: semantic-release
uses: open-sauced/release@v2
env:
# This ensures that publishing happens on every single trigger which then
# forces the go binaries to be built in the next step and attached to the GitHub release
FORCE_PUBLISH: "patch"

GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_PACKAGE_ROOT: "npm"
uses: open-sauced/release@v2.2.1

outputs:
release-tag: ${{ steps.semantic-release.outputs.release-tag }}
SKIP_DOCKER_PUBLISH: true

build:
name: Build and publish artifacts
needs:
- release
if: needs.release.outputs.release-tag != ''
runs-on: ubuntu-latest
permissions:
contents: write # release changes require contents write
# release changes require contents write so that it can push Go binaries
contents: write
strategy:
matrix:
goos: [darwin, linux, windows]
goarch: [amd64, arm64]

steps:
- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- name: "☁️ checkout repository"
uses: actions/checkout@v4

- name: "🐹 Setup Go"
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x

- name: Check out code
uses: actions/checkout@v3
- name: "🤲 Setup Just"
uses: extractions/setup-just@v2

- name: Build and upload Go binaries
- name: "🔧 Build all and upload artifacts to release"
env:
GH_TOKEN: ${{ github.token }}
run: |
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \
-ldflags="-s -w" \
-ldflags="-X 'github.com/open-sauced/pizza-cli/pkg/utils.writeOnlyPublicPosthogKey=${{ vars.POSTHOG_WRITE_PUBLIC_KEY }}'" \
-ldflags="-X 'github.com/open-sauced/pizza-cli/pkg/utils.Version=${{ needs.release.outputs.release-tag }}'" \
-ldflags="-X 'github.com/open-sauced/pizza-cli/pkg/utils.Sha=$(git rev-parse HEAD)'" \
-o build/pizza-${{ matrix.goos }}-${{ matrix.goarch }}
export RELEASE_TAG_VERSION=${{ needs.release.outputs.release-tag }}
just build-${{ matrix.goos }}-${{ matrix.goarch }}
gh release upload ${{ needs.release.outputs.release-tag }} build/pizza-${{ matrix.goos }}-${{ matrix.goarch }}
docker:
name: Build and push container
needs:
- release
if: needs.release.outputs.release-tag != ''
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v4

- name: "🔧 setup buildx"
uses: docker/setup-buildx-action@v3

- name: "🐳 Login to ghcr"
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "📦 docker build and push"
uses: docker/build-push-action@v6
with:
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ needs.release.outputs.release-tag }}
push: true
37 changes: 19 additions & 18 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Lint, test, and build
name: "Lint, test, and build"

on:
workflow_call:
push:
branches:
- main
Expand All @@ -12,41 +13,41 @@ on:
- reopened

permissions:

# So golangci-lint can read the contents of the lint yaml file
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: '1.22'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.54.2
version: v1.59.1

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: '1.22'
- uses: extractions/setup-just@v2
- name: Test
run: make test
run: just test

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Build go binary
run: make build
go-version: '1.22'
- uses: extractions/setup-just@v2
- name: Build Go binary
run: just build
12 changes: 11 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ linters:
- staticcheck
- unconvert
- unused
- vet
- govet
- gci

linters-settings:
gci:
sections:
# include the default standard section, default section, and the "local"
# section which can be configured with
# 'goimports -local github.com/open-sauced/saucectl'
- standard
- default
- localmodule

run:
timeout: 5m
15 changes: 15 additions & 0 deletions .sauced.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Configuration for attributing commits with emails to GitHub user profiles
# Used during codeowners generation.

# List the emails associated with the given username.
# The commits associated with these emails will be attributed to
# the username in this yaml map. Any number of emails may be listed.
attribution:
brandonroberts:
- robertsbt@gmail.com
jpmcb:
- john@opensauced.pizza
nickytonline:
- nick@nickyt.co
- nick@opensauced.pizza

Loading

0 comments on commit 6542f22

Please sign in to comment.