Skip to content

build

build #11

Workflow file for this run

name: build
on: workflow_dispatch
env:
GO_VERSION: "1.18"
NODE_VERSION: "16"
JAVA_VERSION: "11"
ANT_VERSION: "1.10.8"
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF8"
jobs:
build:
runs-on: windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
-
name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
-
name: Set up Java
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: ${{ env.JAVA_VERSION }}
-
name: Set up ANT
run: |
choco install ant --no-progress --force -y --version $Env:ANT_VERSION
$Env:PATH = "C:\ProgramData\chocolatey\lib\ant\tools\apache-ant-$Env:ANT_VERSION\bin;$Env:PATH"
echo "ANT_HOME=C:\ProgramData\chocolatey\lib\ant\tools\apache-ant-$Env:ANT_VERSION" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
-
name: Java version
run: |
java -XshowSettings:properties -version
-
name: ANT version
run: |
ant -version
-
name: Node version
run: |
node --version
-
name: Config
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
echo "$(go env GOPATH)/bin/windows_386" >> $GITHUB_PATH
echo "PORTAPPS_VERSION=$(cat go.mod | grep github.com/portapps/portapps | awk '{print $NF}')" >> $GITHUB_ENV
echo "PORTAPPS_DIR=./.portapps" >> $GITHUB_ENV
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "GIT_TAGNAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
shell: bash
-
name: Checkout core
uses: actions/checkout@v3
with:
repository: portapps/portapps
ref: ${{ env.PORTAPPS_VERSION }}
path: ${{ env.PORTAPPS_DIR }}
-
name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Build
run: |
ant release -Dcore.dir=${{ env.PORTAPPS_DIR }}
shell: bash
-
name: Upload assets
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: bin/release/*
-
name: GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
bin/release/*
name: ${{ env.GIT_TAGNAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v1