2020-10-14 22:09:40 +02:00
|
|
|
name: Build binary artifacts
|
2020-11-29 19:57:12 +01:00
|
|
|
|
2020-10-14 22:09:40 +02:00
|
|
|
on:
|
2020-11-29 02:16:10 +01:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- weekly.**
|
2020-12-03 15:04:49 +01:00
|
|
|
- 0.**
|
2020-11-29 19:57:12 +01:00
|
|
|
|
2020-10-14 22:09:40 +02:00
|
|
|
jobs:
|
2020-11-29 02:16:10 +01:00
|
|
|
build-linux:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
compiler: [gcc]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Compile
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.compiler }}
|
2020-12-29 20:51:12 +01:00
|
|
|
run: |
|
|
|
|
make -j4
|
|
|
|
./v -cc $CC -o v -prod cmd/v
|
|
|
|
./v -prod cmd/tools/vup.v
|
|
|
|
./v -prod cmd/tools/vdoctor.v
|
2020-11-29 02:16:10 +01:00
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: linux
|
|
|
|
path: |
|
|
|
|
.
|
2020-12-29 21:53:22 +01:00
|
|
|
./cmd/tools/vup
|
|
|
|
./cmd/tools/vdoctor
|
2020-11-29 02:16:10 +01:00
|
|
|
!./.git
|
|
|
|
!./vc
|
|
|
|
!./v_old
|
|
|
|
- name: Create binary only artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: linux-binary
|
|
|
|
path: ./v
|
|
|
|
|
|
|
|
build-macos:
|
|
|
|
runs-on: macos-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
compiler: [clang]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Compile
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.compiler }}
|
2020-12-29 20:51:12 +01:00
|
|
|
run: |
|
|
|
|
make -j4
|
|
|
|
./v -cc $CC -o v -prod cmd/v
|
|
|
|
./v -prod cmd/tools/vup.v
|
|
|
|
./v -prod cmd/tools/vdoctor.v
|
2020-11-29 02:16:10 +01:00
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos
|
|
|
|
path: |
|
|
|
|
.
|
2020-12-29 21:53:22 +01:00
|
|
|
./cmd/tools/vup
|
|
|
|
./cmd/tools/vdoctor
|
2020-11-29 02:16:10 +01:00
|
|
|
!./.git
|
|
|
|
!./vc
|
|
|
|
!./v_old
|
|
|
|
- name: Create binary only artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos-binary
|
|
|
|
path: ./v
|
|
|
|
build-windows:
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
|
|
- name: Compile
|
2020-12-29 20:51:12 +01:00
|
|
|
run: |
|
|
|
|
.\make.bat
|
|
|
|
.\v.exe cmd\tools\vup.v
|
|
|
|
.\v.exe cmd\tools\vdoctor.v
|
2020-11-29 02:16:10 +01:00
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: windows
|
|
|
|
path: |
|
|
|
|
.
|
2020-12-29 21:53:22 +01:00
|
|
|
./cmd/tools/vup.exe
|
|
|
|
./cmd/tools/vdoctor.exe
|
2020-11-29 02:16:10 +01:00
|
|
|
!./.git
|
|
|
|
!./vc
|
|
|
|
!./v_old
|
|
|
|
- name: Create binary only artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: windows-binary
|
|
|
|
path: ./v.exe
|
|
|
|
|
|
|
|
release:
|
|
|
|
name: Create Github Release
|
|
|
|
needs: [build-linux, build-windows, build-macos]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Get short tag name
|
|
|
|
uses: jungwinter/split@v1
|
|
|
|
id: split
|
|
|
|
with:
|
|
|
|
msg: ${{ github.ref }}
|
|
|
|
seperator: /
|
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
tag: ${{ steps.split.outputs._2 }}
|
|
|
|
name: ${{ steps.split.outputs._2 }}
|
|
|
|
commit: ${{ github.sha }}
|
|
|
|
draft: false
|
|
|
|
prerelease: false
|
|
|
|
|
|
|
|
publish:
|
|
|
|
needs: [release]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
version: [linux, macos, windows]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Fetch artifacts
|
|
|
|
uses: actions/download-artifact@v1
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.version }}
|
|
|
|
path: ./${{ matrix.version }}
|
2020-12-03 11:51:28 +01:00
|
|
|
- name: Build Zip Archives
|
|
|
|
run: |
|
2020-12-03 21:43:16 +01:00
|
|
|
mkdir -p workdir/
|
|
|
|
mv ${{ matrix.version }}/ workdir/v/
|
|
|
|
cd workdir/v/
|
2020-12-03 11:51:28 +01:00
|
|
|
chmod 755 v || true
|
2020-12-03 15:04:49 +01:00
|
|
|
chmod 755 v.exe || true
|
2020-12-04 13:08:18 +01:00
|
|
|
chmod 755 thirdparty/tcc/tcc.exe || true
|
2020-12-29 20:51:12 +01:00
|
|
|
chmod 755 cmd/tools/vup || true
|
|
|
|
chmod 755 cmd/tools/vup.exe || true
|
|
|
|
chmod 755 cmd/tools/vdoctor || true
|
|
|
|
chmod 755 cmd/tools/vdoctor.exe || true
|
2020-12-03 11:51:28 +01:00
|
|
|
cd ..
|
2020-12-03 21:43:16 +01:00
|
|
|
zip -r9 --symlinks ../v_${{ matrix.version }}.zip v/*
|
|
|
|
cd ..
|
|
|
|
rm -rf workdir/
|
2020-11-29 02:16:10 +01:00
|
|
|
- name: Get short tag name
|
|
|
|
uses: jungwinter/split@v1
|
|
|
|
id: split
|
|
|
|
with:
|
|
|
|
msg: ${{ github.ref }}
|
|
|
|
seperator: /
|
|
|
|
- name: Get release
|
|
|
|
id: get_release_info
|
|
|
|
uses: leahlundqvist/get-release@v1.3.1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ steps.split.outputs._2 }}
|
|
|
|
- name: Upload Release Asset
|
2020-11-29 19:57:12 +01:00
|
|
|
id: upload-release-asset
|
2020-11-29 02:16:10 +01:00
|
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
|
2020-12-01 04:07:28 +01:00
|
|
|
asset_path: ./v_${{ matrix.version }}.zip
|
|
|
|
asset_name: v_${{ matrix.version }}.zip
|
2020-11-29 19:57:12 +01:00
|
|
|
asset_content_type: application/zip
|