Olares/.github/workflows/release-cli.yaml

71 lines
1.9 KiB
YAML

name: Release CLI
on:
workflow_call:
inputs:
version:
type: string
required: true
ref:
type: string
repository:
type: string
release-id:
type: string
workflow_dispatch:
inputs:
version:
type: string
required: true
ref:
type: string
repository:
type: string
release-id:
type: string
jobs:
goreleaser:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ inputs.ref }}
repository: ${{ inputs.repository }}
- name: Add Local Git Tag For GoReleaser
run: git tag ${{ inputs.version }}
continue-on-error: true
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.24.3
- name: Install x86_64 cross-compiler
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Install ARM cross-compiler
run: sudo apt-get update && sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3.1.0
with:
distribution: goreleaser
workdir: './cli'
version: v1.18.2
args: release --clean
env:
OLARES_RELEASE_ID: ${{ inputs.release-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
run: |
cd cli/output && for file in $(ls *.tar.gz | grep -v no-release-id); do
aws s3 cp "$file" s3://terminus-os-install${{ secrets.REPO_PATH }}${file} --acl=public-read
done