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:
|
2021-08-16 10:13:50 +02:00
|
|
|
tags:
|
|
|
|
- weekly.**
|
|
|
|
- 0.**
|
2020-11-29 19:57:12 +01:00
|
|
|
|
2020-10-14 22:09:40 +02:00
|
|
|
jobs:
|
2021-08-16 10:13:50 +02:00
|
|
|
|
2020-11-29 02:16:10 +01:00
|
|
|
build-linux:
|
2021-01-01 14:14:03 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-12 19:08:55 +01:00
|
|
|
env:
|
2021-08-16 10:13:50 +02:00
|
|
|
CC: gcc
|
2021-12-14 10:10:46 +01:00
|
|
|
ZIPNAME: v_linux.zip
|
2021-02-12 19:08:55 +01:00
|
|
|
steps:
|
2021-08-16 10:13:50 +02:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Compile
|
|
|
|
run: |
|
2021-12-14 10:10:46 +01:00
|
|
|
make -j4
|
|
|
|
./v -cc $CC -prod -o v cmd/v
|
|
|
|
./v -cc $CC -prod cmd/tools/vup.v
|
|
|
|
./v -cc $CC -prod cmd/tools/vdoctor.v
|
|
|
|
- name: Remove excluded
|
|
|
|
run: |
|
|
|
|
rm -rf .git
|
|
|
|
rm -rf vc/
|
|
|
|
rm -rf v_old
|
|
|
|
- name: Create ZIP archive
|
|
|
|
run: |
|
|
|
|
cd ..
|
|
|
|
zip -r9 --symlinks $ZIPNAME v/
|
|
|
|
mv $ZIPNAME v/
|
|
|
|
cd v/
|
2021-08-16 10:13:50 +02:00
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: linux
|
2021-12-14 10:10:46 +01:00
|
|
|
path: v_linux.zip
|
2021-08-16 10:13:50 +02:00
|
|
|
|
2020-11-29 02:16:10 +01:00
|
|
|
build-macos:
|
|
|
|
runs-on: macos-latest
|
2021-12-14 10:10:46 +01:00
|
|
|
env:
|
|
|
|
CC: clang
|
|
|
|
ZIPNAME: v_macos.zip
|
2020-11-29 02:16:10 +01:00
|
|
|
steps:
|
2021-08-16 10:13:50 +02:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Compile
|
|
|
|
run: |
|
|
|
|
make -j4
|
2021-12-14 10:10:46 +01:00
|
|
|
./v -cc $CC -prod -o v cmd/v
|
|
|
|
./v -cc $CC -prod cmd/tools/vup.v
|
|
|
|
./v -cc $CC -prod cmd/tools/vdoctor.v
|
|
|
|
- name: Remove excluded
|
|
|
|
run: |
|
|
|
|
rm -rf .git
|
|
|
|
rm -rf vc/
|
|
|
|
rm -rf v_old
|
|
|
|
- name: Create ZIP archive
|
|
|
|
run: |
|
|
|
|
cd ..
|
|
|
|
zip -r9 --symlinks $ZIPNAME v/
|
|
|
|
mv $ZIPNAME v/
|
|
|
|
cd v/
|
2021-08-16 10:13:50 +02:00
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos
|
2021-12-14 10:10:46 +01:00
|
|
|
path: v_macos.zip
|
2021-08-16 10:13:50 +02:00
|
|
|
|
2020-11-29 02:16:10 +01:00
|
|
|
build-windows:
|
|
|
|
runs-on: windows-latest
|
2021-12-14 10:10:46 +01:00
|
|
|
env:
|
|
|
|
CC: msvc
|
|
|
|
ZIPNAME: v_windows.zip
|
2020-11-29 02:16:10 +01:00
|
|
|
steps:
|
2021-08-16 10:13:50 +02:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
|
|
- name: Compile
|
|
|
|
run: |
|
2021-12-14 10:10:46 +01:00
|
|
|
.\make.bat -tcc
|
2021-08-16 10:13:50 +02:00
|
|
|
.\v.exe cmd\tools\vup.v
|
|
|
|
.\v.exe cmd\tools\vdoctor.v
|
2021-12-14 10:10:46 +01:00
|
|
|
- name: Remove excluded
|
|
|
|
shell: msys2 {0}
|
|
|
|
run: |
|
|
|
|
rm -rf .git
|
|
|
|
rm -rf vc/
|
|
|
|
rm -rf v_old.exe
|
|
|
|
- name: Create archive
|
|
|
|
shell: msys2 {0}
|
|
|
|
run: |
|
|
|
|
cd ..
|
2021-12-14 11:20:20 +01:00
|
|
|
powershell Compress-Archive v $ZIPNAME
|
2021-12-14 10:10:46 +01:00
|
|
|
mv $ZIPNAME v/
|
|
|
|
cd v/
|
2021-12-14 11:20:20 +01:00
|
|
|
# NB: the powershell Compress-Archive line is from:
|
|
|
|
# https://superuser.com/a/1336434/194881
|
|
|
|
# It is needed, because `zip` is not installed by default :-|
|
2021-08-16 10:13:50 +02:00
|
|
|
- name: Create artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: windows
|
2021-12-14 10:10:46 +01:00
|
|
|
path: v_windows.zip
|
2020-11-29 02:16:10 +01:00
|
|
|
|
|
|
|
release:
|
|
|
|
name: Create Github Release
|
2021-08-16 10:20:39 +02:00
|
|
|
needs: [build-linux, build-windows, build-macos]
|
2021-01-01 14:14:03 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-29 02:16:10 +01:00
|
|
|
steps:
|
2021-08-16 10:13:50 +02: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 02:16:10 +01:00
|
|
|
|
|
|
|
publish:
|
|
|
|
needs: [release]
|
2021-01-01 14:14:03 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-29 02:16:10 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-08-16 10:13:50 +02:00
|
|
|
version: [linux, macos, windows]
|
2020-11-29 02:16:10 +01:00
|
|
|
steps:
|
2021-08-16 10:13:50 +02:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Fetch artifacts
|
|
|
|
uses: actions/download-artifact@v1
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.version }}
|
|
|
|
path: ./${{ matrix.version }}
|
|
|
|
- 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 }}
|
2021-12-14 10:10:46 +01:00
|
|
|
asset_path: ${{ matrix.version }}/v_${{ matrix.version }}.zip
|
2021-08-16 10:13:50 +02:00
|
|
|
asset_name: v_${{ matrix.version }}.zip
|
|
|
|
asset_content_type: application/zip
|