👷 Add release CI
This commit is contained in:
5
CHANGELOG.md
Normal file
5
CHANGELOG.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
# v0.0.1
|
||||
|
||||
- Initial release
|
||||
38
Makefile
38
Makefile
@@ -7,3 +7,41 @@ compile:
|
||||
@cd src && \
|
||||
go build -o ../build/otter && \
|
||||
cd ..
|
||||
|
||||
compile_windows_64:
|
||||
@echo "Compiling for Windows 64..."
|
||||
@cd src && \
|
||||
GOOS=windows GOARCH=amd64 go build -o ../build/otter-amd64.exe && \
|
||||
cd ..
|
||||
|
||||
compile_windows_32:
|
||||
@echo "Compiling for Windows 32..."
|
||||
@cd src && \
|
||||
GOOS=windows GOARCH=386 go build -o ../build/otter-386.exe && \
|
||||
cd ..
|
||||
|
||||
compile_linux_64:
|
||||
@echo "Compiling for Linux 64..."
|
||||
@cd src && \
|
||||
GOOS=linux GOARCH=amd64 go build -o ../build/otter-linux-amd64 && \
|
||||
cd ..
|
||||
|
||||
compile_linux_32:
|
||||
@echo "Compiling for Linux 32..."
|
||||
@cd src && \
|
||||
GOOS=linux GOARCH=386 go build -o ../build/otter-linux-386 && \
|
||||
cd ..
|
||||
|
||||
compile_mac_64:
|
||||
@echo "Compiling for Mac 64..."
|
||||
@cd src && \
|
||||
GOOS=darwin GOARCH=amd64 go build -o ../build/otter-mac-amd64 && \
|
||||
cd ..
|
||||
|
||||
compile_mac_arm:
|
||||
@echo "Compiling for Mac ARM..."
|
||||
@cd src && \
|
||||
GOOS=darwin GOARCH=arm64 go build -o ../build/otter-mac-arm64 && \
|
||||
cd ..
|
||||
|
||||
compile_all: compile_windows_32 compile_windows_64 compile_linux_32 compile_linux_64 compile_mac_64 compile_mac_arm
|
||||
|
||||
90
workflows/Release.yml
Normal file
90
workflows/Release.yml
Normal file
@@ -0,0 +1,90 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build_release:
|
||||
name: build_release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: build artifacts
|
||||
run: make compile
|
||||
shell: bash
|
||||
- name: version
|
||||
run: echo "::set-output name=version::$(./otter version)"
|
||||
id: version
|
||||
- name: build artifacts
|
||||
run: make deploy_all
|
||||
shell: bash
|
||||
- name: release
|
||||
uses: actions/create-release@v1
|
||||
id: create_release
|
||||
with:
|
||||
draft: false
|
||||
prerelease: false
|
||||
release_name: ${{ steps.version.outputs.version }}
|
||||
tag_name: ${{ github.ref }}
|
||||
body_path: CHANGELOG.md
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
- name: upload windows64 artifact
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./out/otter-amd64.exe
|
||||
asset_name: otter-amd64.exe
|
||||
asset_content_type: application/x-dosexec
|
||||
- name: upload windows32 artifact
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./out/otter-386.exe
|
||||
asset_name: otter-386.exe
|
||||
asset_content_type: application/x-dosexec
|
||||
- name: upload linux64 artifact
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./out/otter-linux-amd64
|
||||
asset_name: otter-linux-amd64
|
||||
asset_content_type: application/x-executable
|
||||
- name: upload linux32 artifact
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./out/otter-linux-386
|
||||
asset_name: otter-linux-386
|
||||
asset_content_type: application/x-executable
|
||||
- name: upload mac intel64 artifact
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./out/otter-mac-amd64
|
||||
asset_name: otter-mac-amd64
|
||||
asset_content_type: application/x-mach-binary
|
||||
- name: upload mac arm64 artifact
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./out/otter-mac-arm64
|
||||
asset_name: otter-mac-arm64
|
||||
asset_content_type: application/x-mach-binary
|
||||
Reference in New Issue
Block a user