61 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			61 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Release
 | 
						|
 | 
						|
on:
 | 
						|
  push:
 | 
						|
    tags:
 | 
						|
      - "v*.*.*"
 | 
						|
 | 
						|
permissions:
 | 
						|
  contents: write
 | 
						|
 | 
						|
jobs:
 | 
						|
  build:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    env:
 | 
						|
      CGO_ENABLED: 1
 | 
						|
    steps:
 | 
						|
      - name: Checkout codebase
 | 
						|
        uses: actions/checkout@v3
 | 
						|
        with:
 | 
						|
          fetch-depth: 0
 | 
						|
 | 
						|
      - name: Build Yggdrasil Server
 | 
						|
        uses: crazy-max/ghaction-xgo@v2
 | 
						|
        with:
 | 
						|
          xgo_version: latest
 | 
						|
          go_version: 1.19
 | 
						|
          dest: build
 | 
						|
          prefix: yggdrasil
 | 
						|
          targets: windows/amd64,linux/amd64,linux/arm64,darwin/amd64,darwin/arm64
 | 
						|
          v: true
 | 
						|
          x: false
 | 
						|
          race: false
 | 
						|
          ldflags: -s -w -buildid=
 | 
						|
          tags: nomsgpack sqlite mysql
 | 
						|
          trimpath: true
 | 
						|
 | 
						|
      - name: Prepare package
 | 
						|
        run: cp -v ./config_example.ini ./build
 | 
						|
 | 
						|
      - name: Create ZIP archive
 | 
						|
        run: |
 | 
						|
          pushd build || exit 1
 | 
						|
          ls -alh
 | 
						|
          zip -9vr ../yggdrasil.zip .
 | 
						|
          popd || exit 1
 | 
						|
          FILE=./yggdrasil.zip
 | 
						|
          DGST=$FILE.dgst
 | 
						|
          openssl dgst -md5    $FILE | sed 's/([^)]*)//g' >>$DGST
 | 
						|
          openssl dgst -sha1   $FILE | sed 's/([^)]*)//g' >>$DGST
 | 
						|
          openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >>$DGST
 | 
						|
          openssl dgst -sha512 $FILE | sed 's/([^)]*)//g' >>$DGST
 | 
						|
 | 
						|
      - name: Upload files to GitHub release
 | 
						|
        uses: softprops/action-gh-release@v1
 | 
						|
        if: startsWith(github.ref, 'refs/tags/')
 | 
						|
        with:
 | 
						|
          prerelease: true
 | 
						|
          body: For test only
 | 
						|
          name: ${{ github.ref_name }} Pre Release
 | 
						|
          files: yggdrasil.zip*
 |