-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Teleport Releaser | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
|
||
jobs: | ||
packer: | ||
strategy: | ||
matrix: | ||
os: ['linux', 'amd64', 'arm64'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name : clone teleport | ||
uses: actions/checkout@v2 | ||
|
||
- name: Go environment | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.18 | ||
|
||
# building go package based on os version - we use release tag for version | ||
- name: ABC Package for Linux and Darwin-amd64 | ||
if: ${{matrix.os == 'linux'}} | ||
run: go build -o "teleport" . | ||
env: | ||
GOOS: linux | ||
GOARCH: amd64 | ||
|
||
- name: Package for Darwin-Arm64 | ||
if: ${{matrix.os == 'arm64'}} | ||
run: go build -o "teleport-mac" . | ||
env: | ||
GOOS: darwin | ||
GOARCH: arm64 | ||
|
||
- name: Package for Darwin-AMD64 | ||
if: ${{matrix.os == 'amd64'}} | ||
run: go build -o "teleport-mac-amd" . | ||
env: | ||
GOOS: darwin | ||
GOARCH: amd64 | ||
|
||
|
||
# creating zip files for each os | ||
- name: Zip | ||
run: sudo apt -y update && sudo apt -y install zip | ||
|
||
- name: Packing into zip for Linux | ||
if: ${{matrix.os == 'linux'}} | ||
run: zip -r "teleport.zip" "teleport" | ||
|
||
- name: Packing into zip for Darwin-arm64 | ||
if: ${{matrix.os == 'arm64'}} | ||
run: zip -r "-${{matrix.os}}-${{github.event.release.tag_name}}.zip" "teleport-mac" | ||
|
||
- name: Packing into zip for Darwin-amd64 | ||
if: ${{matrix.os == 'amd64'}} | ||
run: zip -r "-${{matrix.os}}-${{github.event.release.tag_name}}.zip" "teleport-mac-amd" | ||
|
||
- name: show where we are | ||
run: echo $(pwd) | ||
|
||
# Uploading the package to it's release based on release tag | ||
- name: Upload binaries to release for Linux | ||
if: ${{matrix.os != 'amd64' && matrix.os != 'arm64'}} | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{secrets.RELEASER}} | ||
file: "teleport.zip" | ||
asset_name: "teleport.zip" | ||
tag: ${{github.event.release.tag_name}} | ||
|
||
- name: Upload binaries to release for amd64 and arm64 | ||
if: ${{matrix.os == 'amd64' || matrix.os == 'arm64' }} | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{secrets.RELEASER}} | ||
file: "teleport-${{matrix.os}}-${{github.event.release.tag_name}}.zip" | ||
asset_name: "teleport-${{matrix.os}}-${{github.event.release.tag_name}}.zip" | ||
tag: ${{github.event.release.tag_name}} |