Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github/workflows: cd workflow #72

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Upload to CDN
on:
workflow_dispatch:
inputs:
commit:
description: 'Commit SHA'
required: false
version:
description: 'Version (should follow semver v1.2.3)'
required: false
push:
branches:
- master
jobs:
test:
uses: ./.github/workflows/ci-go.yaml
secrets: inherit
build:
needs: test
runs-on: ubuntu-latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

building only for ubuntu?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now it will suffice, but sure we can add it soon

steps:
- name: Checkout code
uses: actions/[email protected]
with:
ref: ${{ github.event.inputs.commit || 'master' }}
- name: Setup Go Environment
uses: actions/setup-go@v2
rotemtam marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: '1.21'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go-file-version exists and takes the version from go.mod :)

rotemtam marked this conversation as resolved.
Show resolved Hide resolved
- name: Set BINARY_NAME
id: set_binary_name
run: |
echo "BINARY_NAME=atlas-action-${{ github.event.inputs.version || 'v1' }}" >> $GITHUB_ENV
- name: Compile Go Binary
run: |
go build -o $BINARY_NAME ./cmd/atlas-action
- name: Configure AWS credentials
run: |
aws configure set aws_access_key_id ${{ secrets.RELEASE_AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.RELEASE_AWS_SECRET_ACCESS_KEY }}
- name: Upload binary to S3
env:
AWS_REGION: us-east-1
run: |
aws s3 cp $BINARY_NAME s3://release.ariga.io/atlas-action/$BINARY_NAME
1 change: 1 addition & 0 deletions .github/workflows/ci-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- master
pull_request:
workflow_call:
jobs:
golangci-lint:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
- master
pull_request:
workflow_dispatch:

jobs:
sanity:
strategy:
Expand Down
Loading