2020-06-04 22:13:42 +08:00
|
|
|
# Based on the https://github.com/actions/upload-release-asset example
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
# Sequence of patterns matched against refs/tags
|
|
|
|
tags:
|
|
|
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
|
|
|
|
|
|
name: Upload Release Asset
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Upload Release Asset
|
2020-07-12 22:31:15 +08:00
|
|
|
runs-on: ubuntu-20.04
|
2020-06-04 22:13:42 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2020-07-12 22:31:15 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-06-04 22:13:42 +08:00
|
|
|
- name: Build assets
|
|
|
|
run: |
|
|
|
|
make release-assets
|
|
|
|
- id: name
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=tarball::$(ls *.tar.gz)"
|
|
|
|
echo "::set-output name=zip::$(ls *.zip)"
|
2020-09-30 16:58:27 +08:00
|
|
|
echo "::set-output name=suffix_unix::$(sed 's|^\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\)\.\(.*\)$|\1|' dist/VERSION)"
|
|
|
|
echo "::set-output name=suffix_dos::$(sed 's|^\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\)\.\(.*\)$|\1|' dist/VERSION | tr . _)"
|
2020-06-04 22:13:42 +08:00
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
|
|
|
release_name: Release ${{ github.ref }}
|
|
|
|
draft: true
|
|
|
|
prerelease: true
|
|
|
|
- name: Upload tarball
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: ${{ steps.name.outputs.tarball }}
|
2020-09-30 16:58:27 +08:00
|
|
|
asset_name: libmdbx-amalgamated-${{ steps.name.outputs.suffix_unix }}.tar.gz
|
2020-06-04 22:13:42 +08:00
|
|
|
# asset_label: Amalgamated source tarball
|
|
|
|
asset_content_type: application/tar+gzip
|
|
|
|
- name: Upload zip
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: ${{ steps.name.outputs.zip }}
|
2020-09-30 16:58:27 +08:00
|
|
|
asset_name: libmdbx-amalgamated-${{ steps.name.outputs.suffix_dos }}.zip
|
2020-06-04 22:13:42 +08:00
|
|
|
# asset_label: Amalgamated source zip-archive
|
|
|
|
asset_content_type: application/zip
|