build: use go install
This commit is contained in:
		
							parent
							
								
									2e79ac4460
								
							
						
					
					
						commit
						87170420e4
					
				@ -5,7 +5,7 @@
 | 
			
		||||
  tasks:
 | 
			
		||||
  - name: Copy build to remote
 | 
			
		||||
    ansible.builtin.copy:
 | 
			
		||||
      src: ../build/ev
 | 
			
		||||
      src: ../ev
 | 
			
		||||
      dest: /usr/local/bin/ev 
 | 
			
		||||
      owner: root 
 | 
			
		||||
      group: root
 | 
			
		||||
 | 
			
		||||
@ -9,12 +9,8 @@ on:
 | 
			
		||||
jobs:
 | 
			
		||||
  deploy:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:    
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/checkout@v3
 | 
			
		||||
      with:
 | 
			
		||||
        fetch-depth: 0
 | 
			
		||||
        fetch-tags: true
 | 
			
		||||
 | 
			
		||||
    - run: apt-get update && apt-get -y install ansible
 | 
			
		||||
 | 
			
		||||
    - name: Set up Go
 | 
			
		||||
@ -22,15 +18,17 @@ jobs:
 | 
			
		||||
      with:
 | 
			
		||||
        go-version: 1.21.1
 | 
			
		||||
 | 
			
		||||
    - name: Build
 | 
			
		||||
      run: go build -ldflags "-s -w" -o ./build/ev ./cmd/ev
 | 
			
		||||
    - name: Install
 | 
			
		||||
      run: go install -ldflags "-s -w" go.sour.is/tools/cmd/ev@latest
 | 
			
		||||
 | 
			
		||||
    - run: mv $(go env GOPATH)/bin/ev ev
 | 
			
		||||
 | 
			
		||||
    - name: Compress
 | 
			
		||||
      uses: https://git.sour.is/actions/ghaction-upx@v2.4.0
 | 
			
		||||
      with:
 | 
			
		||||
        version: latest
 | 
			
		||||
        files: |
 | 
			
		||||
            ./build/ev
 | 
			
		||||
            ./ev
 | 
			
		||||
        args: -fq
 | 
			
		||||
 | 
			
		||||
    - name: Deploy
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user