Skip to content

Commit

Permalink
feat: Adding release please (#4)
Browse files Browse the repository at this point in the history
feat: We added release please. Currently it only does a github release (hopefully)
  • Loading branch information
Sunny Guduru authored Mar 8, 2024
1 parent 0cf0540 commit 4515a4c
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Artifacts
description: 'Publish artifacts to Github Release'
inputs:
token:
description: 'Token to use for publishing.'
required: true
dry-run:
description: 'Is this a dry run. If so no package will be published.'
required: false
default: 'true'
tag:
description: 'Tag to upload artifacts to.'
required: true

runs:
using: composite
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386
- name: Git clean
shell: bash
run: git clean -f
- name: Login to Docker
shell: bash
run: |
echo $DOCKER_TOKEN | docker login --username $DOCKER_USERNAME --password-stdin
- name: Run Goreleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean ${{ inputs.dry-run == 'true' && '--skip=publish' || '' }}
env:
GITHUB_TOKEN: ${{ inputs.token }}

- name: Upload Release Artifacts
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: |
gh release upload ${{ inputs.tag }} ./dist/*.deb ./dist/*.rpm ./dist/*.tar.gz ./dist/*.txt --clobber
38 changes: 38 additions & 0 deletions .github/actions/release-secrets/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release Secrets
# Currently this handles SSM, but once we need an s3 secret we should add support.
description: 'Action for getting release secrets from SSM'
inputs:
aws_assume_role:
description: 'The ARN of an AWS IAM role to assume. Used to auth with AWS to upload results to S3.'
required: true
# This uses this format to allow using the GetParameters action.
ssm_parameter_pairs:
description: 'A series of pairs of paths to environment mappings. "/path = ENV_NAME, /path2 = ENV_NAME2"'
required: false
# If we add S3, then just have a list of S3 paths.
s3_path_pairs:
description: 'A series of pairs of s3 paths to local paths. The local paths are relative to the project root. "some/s3/path = local-path/file"'
required: false

runs:
using: composite
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
audience: https://github.com/launchdarkly
role-to-assume: ${{ inputs.aws_assume_role }}
aws-region: us-east-1
- name: Load environment variables
uses: dkershner6/aws-ssm-getparameters-action@4fcb4872421f387a6c43058473acc1b22443fe13
if: ${{ inputs.ssm_parameter_pairs != '' }}
with:
parameterPairs: ${{ inputs.ssm_parameter_pairs }}
withDecryption: 'true'
- name: Download S3 files
shell: bash
if: ${{ inputs.s3_path_pairs != '' }}
env:
PATH_PAIRS: ${{ inputs.s3_path_pairs }}
run: |
source $GITHUB_ACTION_PATH/s3-copy.sh
2 changes: 2 additions & 0 deletions .github/variables/go-versions.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
latest=1.22.1
penultimate=1.21.8
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run Release Please

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
release-type: "go"
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## [0.0.1] - 2024-03-06

### Added

- CI tests
- Hardcoded wizards

0 comments on commit 4515a4c

Please sign in to comment.