Skip to content

Commit

Permalink
Added CI/CD pipeline to release
Browse files Browse the repository at this point in the history
  • Loading branch information
applejag committed Oct 7, 2023
1 parent f573ee2 commit e2fe838
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-FileCopyrightText: 2019 Replicated, Inc.
#
# SPDX-License-Identifier: Apache-2.0

name: build
on:
pull_request:
branches: [main]
jobs:
goreleaser-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Setup Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Create Snapcraft cache dirs
run: |
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean --skip=publish --snapshot
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,32 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@master

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Setup Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Create Snapcraft cache dirs
run: |
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update new version in krew-index
uses: rajatjindal/krew-release-bot@v0.0.46

- name: Publish Snaps to the Snap Store (stable channel)
run: for snap in $(ls dist/*.snap); do snapcraft upload --release=stable $snap; done
env:
SNAPCRAFT_STORE_AUTH: candid
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}

0 comments on commit e2fe838

Please sign in to comment.