-
Notifications
You must be signed in to change notification settings - Fork 2
92 lines (92 loc) · 3.17 KB
/
release-cli-version.yml
File metadata and controls
92 lines (92 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Release Enclave CLI version
on:
push:
tags:
- 'v*'
env:
RUST_BACKTRACE: 1
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 "full_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- id: get-major-version
uses: actions/github-script@v7
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-oidc-role-arn: ${{ secrets.AWS_EV_CLI_PRODUCTION_OIDC_ROLE_ARN }}
aws-cloudfront-distribution-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
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@v4.1.8
with:
name: macos
- name: Download Linux Artifacts
uses: actions/download-artifact@v4.1.8
with:
name: linux
- name: Upload Linux Release
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path:
./linux/ev-${{ env.LINUX_TARGET }}-${{
needs.get-version.outputs.full_version }}.tar.gz
asset_content_type: application/gzip
asset_name:
ev-${{ env.LINUX_TARGET }}-${{
needs.get-version.outputs.full_version }}.tar.gz
- name: Upload MacOS Release
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path:
./macos/ev-${{ env.MACOS_TARGET }}-${{
needs.get-version.outputs.full_version }}.tar.gz
asset_content_type: application/gzip
asset_name:
ev-${{ env.MACOS_TARGET }}-${{
needs.get-version.outputs.full_version }}.tar.gz