Skip to content

feat: release v2.7

feat: release v2.7 #6

name: Build for Linux & Windows
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install Docker
run: curl -fsSL https://get.docker.com | bash -s docker
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.20.2
- name: Go tidy
run: go mod tidy
- name: Install fyne-cross
run: go get github.com/fyne-io/fyne-cross && go install github.com/fyne-io/fyne-cross
- name: Package for Windows
run: fyne-cross windows -arch=*
- name: Package for Linux
run: fyne-cross linux -arch=*
- name: Create pkg dist dir
run: mkdir pkg-dist
- name: Move Windows-amd64
run: mv fyne-cross/dist/windows-amd64/Fetch-Github-Hosts.exe.zip pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_amd64.zip
- name: Move Windows-386
run: mv fyne-cross/dist/windows-386/Fetch-Github-Hosts.exe.zip pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_386.zip
- name: Move Linux-386
run: mv fyne-cross/dist/linux-386/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_386.tar.xz
- name: Move Linux-amd64
run: mv fyne-cross/dist/linux-amd64/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_amd64.tar.xz
- name: Move Linux-arm
run: mv fyne-cross/dist/linux-arm/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm.tar.xz
- name: Move Linux-arm64
run: mv fyne-cross/dist/linux-arm64/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm64.tar.xz
- uses: actions/upload-artifact@v3
with:
name: build-result
path: |
pkg-dist
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
append_body: true
files: |
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_amd64.zip
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_386.zip
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_386.tar.xz
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_amd64.tar.xz
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm.tar.xz
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm64.tar.xz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}