2020-10-14 23:09:40 +03:00
|
|
|
name: Build binary artifacts
|
2020-11-29 21:57:12 +03:00
|
|
|
|
2020-10-14 23:09:40 +03:00
|
|
|
on:
|
2020-11-29 04:16:10 +03:00
|
|
|
push:
|
2021-08-16 11:13:50 +03:00
|
|
|
tags:
|
|
|
|
- weekly.**
|
|
|
|
- 0.**
|
2020-11-29 21:57:12 +03:00
|
|
|
|
2020-10-14 23:09:40 +03:00
|
|
|
jobs:
|
2021-08-16 11:13:50 +03:00
|
|
|
|
2020-11-29 04:16:10 +03:00
|
|
|
build-linux:
|
2021-01-01 16:14:03 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-12 21:08:55 +03:00
|
|
|
env:
|
2021-08-16 11:13:50 +03:00
|
|
|
CC: gcc
|
2021-02-12 21:08:55 +03:00
|
|
|
steps:
|
2021-08-16 11:13:50 +03:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Compile
|
|
|
|
run: |
|
|
|
|
make -j4
|
|
|
|
./v -cc $CC -o v -prod cmd/v
|
|
|
|
./v -prod cmd/tools/vup.v
|
|
|
|
./v -prod cmd/tools/vdoctor.v
|
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: linux
|
|
|
|
path: |
|
|
|
|
.
|
|
|
|
./cmd/tools/vup
|
|
|
|
./cmd/tools/vdoctor
|
|
|
|
!./.git
|
|
|
|
!./vc
|
|
|
|
!./v_old
|
|
|
|
- name: Create binary only artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: linux-binary
|
|
|
|
path: ./v
|
|
|
|
|
2020-11-29 04:16:10 +03:00
|
|
|
build-macos:
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
2021-08-16 11:13:50 +03:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Compile
|
|
|
|
env:
|
|
|
|
CC: clang
|
|
|
|
run: |
|
|
|
|
make -j4
|
|
|
|
./v -cc $CC -o v -prod cmd/v
|
|
|
|
./v -prod cmd/tools/vup.v
|
|
|
|
./v -prod cmd/tools/vdoctor.v
|
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos
|
|
|
|
path: |
|
|
|
|
.
|
|
|
|
./cmd/tools/vup
|
|
|
|
./cmd/tools/vdoctor
|
|
|
|
!./.git
|
|
|
|
!./vc
|
|
|
|
!./v_old
|
|
|
|
- name: Create binary only artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos-binary
|
|
|
|
path: ./v
|
|
|
|
|
2020-11-29 04:16:10 +03:00
|
|
|
build-windows:
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
2021-08-16 11:13:50 +03:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
|
|
- name: Compile
|
|
|
|
run: |
|
|
|
|
.\make.bat
|
|
|
|
.\v.exe cmd\tools\vup.v
|
|
|
|
.\v.exe cmd\tools\vdoctor.v
|
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: windows
|
|
|
|
path: |
|
|
|
|
.
|
|
|
|
./cmd/tools/vup.exe
|
|
|
|
./cmd/tools/vdoctor.exe
|
|
|
|
!./.git
|
|
|
|
!./vc
|
|
|
|
!./v_old.exe
|
|
|
|
- name: Create binary only artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: windows-binary
|
|
|
|
path: ./v.exe
|
2020-11-29 04:16:10 +03:00
|
|
|
|
|
|
|
release:
|
|
|
|
name: Create Github Release
|
2021-08-16 11:20:39 +03:00
|
|
|
needs: [build-linux, build-windows, build-macos]
|
2021-01-01 16:14:03 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-29 04:16:10 +03:00
|
|
|
steps:
|
2021-08-16 11:13:50 +03:00
|
|
|
- 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
|
2020-11-29 04:16:10 +03:00
|
|
|
|
|
|
|
publish:
|
|
|
|
needs: [release]
|
2021-01-01 16:14:03 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-29 04:16:10 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-08-16 11:13:50 +03:00
|
|
|
version: [linux, macos, windows]
|
2020-11-29 04:16:10 +03:00
|
|
|
steps:
|
2021-08-16 11:13:50 +03:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Fetch artifacts
|
|
|
|
uses: actions/download-artifact@v1
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.version }}
|
|
|
|
path: ./${{ matrix.version }}
|
|
|
|
- name: Build Zip Archives
|
|
|
|
run: |
|
|
|
|
mkdir -p workdir/
|
|
|
|
mv ${{ matrix.version }}/ workdir/v/
|
|
|
|
cd workdir/v/
|
|
|
|
chmod 755 v || true
|
|
|
|
chmod 755 v.exe || true
|
|
|
|
chmod 755 thirdparty/tcc/tcc.exe || true
|
|
|
|
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
|
|
|
|
rm -rf v_old v_old.exe
|
|
|
|
cd ..
|
|
|
|
zip -r9 --symlinks ../v_${{ matrix.version }}.zip v/*
|
|
|
|
cd ..
|
|
|
|
rm -rf workdir/
|
|
|
|
- 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
|
|
|
|
id: upload-release-asset
|
|
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
|
|
|
|
asset_path: ./v_${{ matrix.version }}.zip
|
|
|
|
asset_name: v_${{ matrix.version }}.zip
|
|
|
|
asset_content_type: application/zip
|