Skip to content

fix build

fix build #11

name: Release Steampipe Plugin Akeyless
on:
workflow_dispatch:
push:
tags:
- 'v*'
env:
SERVICES_BUCKET_AWS: akeylessservices
jobs:
build:
name: Build And Release
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables
run: |
plugin_name=$(echo $GITHUB_REPOSITORY | cut -d'-' -f 3)
echo $plugin_name
echo "PLUGIN_NAME=${plugin_name}" >> $GITHUB_ENV
- name: Exit if goreleaser file is missing
run: |
test -f .goreleaser.yml
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.2
- name: Get latest version tag
run: |-
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Trim tag
run: |-
echo $version
trim=${version#"v"}
echo $trim
echo "version=${trim}" >> $GITHUB_ENV
- name: Validate Version String
run: |-
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Version is valid: $version"
else
echo "Version is invalid: $version"
exit 1
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean --skip=publish --timeout=60m
- name: Connect to AWS using Github OIDC role
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_GITHUB_STEAMPIPE_OIDC_ROLE_PRODUCTION }}
aws-region: us-east-2
- name: Copy files to AWS S3 bucket
run: |
aws s3 cp ./dist s3://"${SERVICES_BUCKET_AWS}/services/steampipe-plugin-akeyless/release/${version}/" --recursive --exclude "*" --include "*.gz"
- name: Slack Notification
if: failure() || success()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: 'operations'
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: 'Release Latest Steampipe Plugin Akeyless, Status: ${{ job.status }}!'
SLACK_MESSAGE: 'Version:${{ env.version }}'
SLACK_WEBHOOK: ${{ secrets.SLACK_OPERATIONS_WEBHOOK }}
MSG_MINIMAL: true
SLACK_FOOTER: Akeyless.io Release Steampipe Plugin Akeyless Pipeline