Skip to content

Commit

Permalink
Merge pull request #1 from shogo82148/build-perl
Browse files Browse the repository at this point in the history
build perl
  • Loading branch information
shogo82148 committed Sep 1, 2019
2 parents fd6081a + 5880140 commit e3359d9
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 24 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/blank.yml/build.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: build perl

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-16.04
- macOS-10.14
perl:
- "5.30.0"
- "5.28.2"
- "5.26.3"
steps:
- uses: actions/checkout@v1
- name: build
run: |
curl -sL https://raw.githubusercontent.com/tokuhirom/Perl-Build/master/perl-build > "$RUNNER_TEMP/perl-build"
MINOR_VERSION=$(echo -n $(echo $PERL_VERSION | cut -d. -f1,2))
perl "$RUNNER_TEMP/perl-build" "$PERL_VERSION" "$RUNNER_TOOL_CACHE/perl/$MINOR_VERSION/x64" --noman
cd "$RUNNER_TOOL_CACHE" && tar zcf "$RUNNER_TEMP/perl.tar.gz" .
env:
PERL_VERSION: ${{ matrix.perl }}

- name: archive
run: |
cd "$RUNNER_TOOL_CACHE" && tar zcf "$RUNNER_TEMP/perl.tar.gz" perl
- name: upload
run: |
MINOR_VERSION=$(echo -n $(echo $PERL_VERSION | cut -d. -f1,2))
RELEASE_ID=$(curl -sSL -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/v0.0.1-alpha" | jq -j .id)
curl -v -H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/octet-stream" \
-d "@$RUNNER_TEMP/perl.tar.gz" \
"https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets?name=perl-$MINOR_VERSION-$BUILD_OS.tar.gz"
env:
GZIP: "-9"
PERL_VERSION: ${{ matrix.perl }}
BUILD_OS: ${{ matrix.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# windows:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os:
# - windows-2019
# # - windows-2016
# perl:
# - "5.30.0"
# - "5.28.2"
# - "5.26.3"
# steps:
# - uses: actions/checkout@v1
# - name: build
# run: |
# Invoke-WebRequest -Uri https://raw.githubusercontent.com/tokuhirom/Perl-Build/master/perl-build -OutFile $env:RUNNER_TEMP\perl-build
# $minor_version = $env:PERL_VERSION.Split(".")[0,1] -join "."
# C:\Strawberry\perl\bin\perl.exe $env:RUNNER_TEMP\perl-build $env:PERL_VERSION $env:RUNNER_TOOL_CACHE\perl\$minor_version\x64 --noman
# env:
# PERL_VERSION: ${{ matrix.perl }}
# shell: powershell

0 comments on commit e3359d9

Please sign in to comment.