fixed label #93
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
on: | |
push: | |
tags: | |
- 'v*' | |
name: Build and publish release | |
jobs: | |
build: | |
name: Build and publish release | |
runs-on: ['self-hosted', 'linux', 'aws'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20.5' | |
- uses: actions/cache@v1 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Test project | |
run: ./test.sh | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | |
- name: Build project | |
run: scripts/build.sh ${{ steps.get_version.outputs.VERSION }} | |
- name: Create release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_version.outputs.VERSION }} | |
release_name: Release ${{ steps.get_version.outputs.VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload tarball | |
id: upload-release-asset-tarball | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./cdflow2-${{ steps.get_version.outputs.VERSION }}.tar.gz | |
asset_name: cdflow2-${{ steps.get_version.outputs.VERSION }}.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload mac binary | |
id: upload-release-asset-mac | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./cdflow2-darwin-amd64 | |
asset_name: cdflow2-darwin-amd64 | |
asset_content_type: application/x-mach-binary | |
- name: Upload linux binary | |
id: upload-release-asset-linux | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./cdflow2-linux-amd64 | |
asset_name: cdflow2-linux-amd64 | |
asset_content_type: application/x-executable | |
- name: Upload windows binary | |
id: upload-release-asset-windows | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./cdflow2-windows-amd64 | |
asset_name: cdflow2-windows-amd64 | |
asset_content_type: application/vnd.microsoft.portable-executable | |
- name: Upload linux ARM binary | |
id: upload-release-asset-linuxarm | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./cdflow2-linux-arm64 | |
asset_name: cdflow2-linux-arm64 | |
asset_content_type: application/x-executable | |
- name: Setup SSH Keys and known_hosts | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
ssh-add - <<< "${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }}" | |
- name: Update homebrew tap | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: scripts/update-homebrew-tap.sh ${{ steps.get_version.outputs.VERSION }} | |