Use public AWS credentials for enclave cli publish (#117) #92
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Enclave CLI version | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
RUST_BACKTRACE: 1 | |
WINDOWS_TARGET: x86_64-pc-windows-msvc | |
MACOS_TARGET: x86_64-apple-darwin | |
LINUX_TARGET: x86_64-unknown-linux-musl | |
STAGE: production | |
# Directories to target during release | |
BIN_DIR: bin | |
RELEASE_DIR: release | |
jobs: | |
get-version: | |
runs-on: ubuntu-latest | |
outputs: | |
full_version: ${{ steps.get-full-version.outputs.full_version }} | |
major_version: ${{ steps.get-major-version.outputs.result }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: get-full-version | |
run: | | |
echo "using version tag ${GITHUB_REF:11}" | |
echo ::set-output name=full_version::${GITHUB_REF:11} | |
- id: get-major-version | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const [ref,tag,version] = context.ref.split('/'); | |
if (version[0] === 'v') { | |
return version.slice(1).split('.')[0]; | |
} | |
return version.split('.')[0]; | |
result-encoding: string | |
build-and-deploy: | |
needs: [get-version] | |
uses: ./.github/workflows/build-and-publish.yml | |
with: | |
stage: 'production' | |
major-version: ${{ needs.get-version.outputs.major_version }} | |
full-version: ${{ needs.get-version.outputs.full_version }} | |
ev-domain: 'evervault.com' | |
secrets: | |
aws-access-key-id: ${{ secrets.PUBLIC_REPO_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.PUBLIC_REPO_AWS_SECRET_ACCESS_KEY }} | |
aws-cloudfront-distribution-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | |
evervault-rust-lib-index: ${{ secrets.RUST_CRYPTO_REGISTRY }} | |
evervault-rust-lib-token: ${{ secrets.CARGO_REGISTRIES_EVERVAULT_RUST_LIBRARIES_TOKEN }} | |
release-cli-version: | |
needs: [ build-and-deploy, get-version ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ needs.get-version.outputs.full_version }} | |
release_name: ${{ needs.get-version.outputs.full_version }} | |
- name: Download MacOS Artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: macos | |
- name: Download Linux Artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: linux | |
- name: Download Windows Artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: windows | |
- name: Upload Linux Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./linux/ev-enclave-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz | |
asset_content_type: application/gzip | |
asset_name: ev-enclave-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz | |
- name: Upload MacOS Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./macos/ev-enclave-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz | |
asset_content_type: application/gzip | |
asset_name: ev-enclave-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz | |
- name: Upload Windows Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./windows/ev-enclave-${{ env.WINDOWS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz | |
asset_content_type: application/gzip | |
asset_name: ev-enclave-${{ env.WINDOWS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz |