Skip to content

Commit

Permalink
Merge pull request #1 from akquinet/fix-cicd
Browse files Browse the repository at this point in the history
fix: trying to add cicd
  • Loading branch information
rwxd authored Jan 8, 2024
2 parents 20ce44d + 0195e8f commit dfb67d1
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
77 changes: 77 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
on:
push:
branches:
- "*"
tags:
- "v*.*.*"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v2
with:
go-version: '1.20'

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Setup
run: make setup

- name: Run pre-commit
run: make pre-commit-all
env:
SKIP: "no-commit-to-branch"

release-binary:
runs-on: ubuntu-latest
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/main')
needs:
- pre-commit
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CICD_APP_ID }}
private-key: ${{ secrets.CICD_APP_PRIVATE_KEY }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: "${{ steps.generate_token.outputs.token }}"

semantic-release:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs:
- pre-commit
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CICD_APP_ID }}
private-key: ${{ secrets.CICD_APP_PRIVATE_KEY }}

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: "${{ steps.generate_token.outputs.token }}"

0 comments on commit dfb67d1

Please sign in to comment.