Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 9e1d440

Browse files
authored
Merge pull request #20 from pjbgf/release130
Add release pre-built static libraries for linux to main
2 parents 00d3e90 + b522021 commit 9e1d440

File tree

1 file changed

+60
-23
lines changed

1 file changed

+60
-23
lines changed

.github/workflows/release.yaml

+60-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: 'Release MacOS static libraries'
2+
name: 'Release static libraries'
33
on:
44
push:
55
tags:
@@ -12,12 +12,67 @@ on:
1212
default: 'rc'
1313
required: true
1414

15+
1516
permissions:
1617
contents: write # needed to write releases
1718

1819
jobs:
1920

20-
mac-build:
21+
github_release:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
25+
steps:
26+
- name: Prepare
27+
id: prep
28+
run: |
29+
VERSION="${{ github.event.inputs.tag }}-${GITHUB_SHA::8}"
30+
if [[ $GITHUB_REF == refs/tags/* ]]; then
31+
VERSION=${GITHUB_REF/refs\/tags\//}
32+
fi
33+
echo ::set-output name=VERSION::${VERSION}
34+
- name: Create Release
35+
id: create_release
36+
uses: actions/create-release@v1
37+
env:
38+
GITHUB_TOKEN: ${{ github.token }}
39+
with:
40+
release_name: ${{ steps.prep.outputs.VERSION }}
41+
tag_name: ${{ steps.prep.outputs.VERSION }}
42+
draft: false
43+
prerelease: true
44+
45+
linux-amd64-release:
46+
runs-on: ubuntu-latest
47+
needs: github_release
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v2
51+
- name: Build static libraries
52+
run: |
53+
TARGET_DIR=${GITHUB_WORKSPACE}/build/libgit2-linux \
54+
BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/amd \
55+
./hack/static.sh all
56+
57+
mkdir -p ./libgit2-linux/
58+
mv ${GITHUB_WORKSPACE}/build/libgit2-linux/include ./libgit2-linux/
59+
mv ${GITHUB_WORKSPACE}/build/libgit2-linux/share ./libgit2-linux/
60+
mv ${GITHUB_WORKSPACE}/build/libgit2-linux/lib ./libgit2-linux/
61+
mv ${GITHUB_WORKSPACE}/build/libgit2-linux/lib64 ./libgit2-linux/
62+
63+
tar -zcvf linux-x86_64-libs.tar.gz libgit2-linux
64+
- name: Upload Release Asset
65+
id: upload-release-asset
66+
uses: actions/upload-release-asset@v1
67+
env:
68+
GITHUB_TOKEN: ${{ github.token }}
69+
with:
70+
upload_url: ${{ needs.github_release.outputs.release_upload_url }}
71+
asset_path: ./linux-x86_64-libs.tar.gz
72+
asset_name: linux-x86_64-libs.tar.gz
73+
asset_content_type: application/gzip
74+
75+
darwin-release:
2176
# This job builds and releases "universal libraries" that are
2277
# supported by both darwin-amd64 and darwin-arm64.
2378
#
@@ -29,6 +84,7 @@ jobs:
2984
# of testing, GitHub's macos-10.15 did not seem to.
3085
# Cross-compiling to arm64 on that runner consistently failed.
3186
runs-on: macos-11
87+
needs: github_release
3288
steps:
3389
- name: Checkout
3490
uses: actions/checkout@v2
@@ -68,35 +124,16 @@ jobs:
68124
${GITHUB_WORKSPACE}/build/libgit2-darwin-amd64/lib/libz.a \
69125
${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64/lib/libz.a
70126
71-
tar -zcvf darwin-libs.tar.gz ./libgit2-darwin
127+
tar -zcvf darwin-libs.tar.gz libgit2-darwin
72128
env:
73129
MACOSX_DEPLOYMENT_TARGET: 10.15
74-
75-
- name: Prepare
76-
id: prep
77-
run: |
78-
VERSION="${{ github.event.inputs.tag }}-${GITHUB_SHA::8}"
79-
if [[ $GITHUB_REF == refs/tags/* ]]; then
80-
VERSION=${GITHUB_REF/refs\/tags\//}
81-
fi
82-
echo ::set-output name=VERSION::${VERSION}
83-
- name: Create Release
84-
id: create_release
85-
uses: actions/create-release@v1
86-
env:
87-
GITHUB_TOKEN: ${{ github.token }}
88-
with:
89-
release_name: ${{ steps.prep.outputs.VERSION }}
90-
tag_name: ${{ steps.prep.outputs.VERSION }}
91-
draft: false
92-
prerelease: true
93130
- name: Upload Release Asset
94131
id: upload-release-asset
95132
uses: actions/upload-release-asset@v1
96133
env:
97134
GITHUB_TOKEN: ${{ github.token }}
98135
with:
99-
upload_url: ${{ steps.create_release.outputs.upload_url }}
136+
upload_url: ${{ needs.github_release.outputs.release_upload_url }}
100137
asset_path: ./darwin-libs.tar.gz
101138
asset_name: darwin-libs.tar.gz
102139
asset_content_type: application/gzip

0 commit comments

Comments
 (0)