mirror of https://github.com/opencardev/aasdk
added releases
parent
8a44477a5e
commit
0a49641c3f
|
@ -3,8 +3,38 @@ name: Build and test with docker
|
|||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
version:
|
||||
outputs:
|
||||
version: ${{ steps.get_version.outputs.version }}
|
||||
buildname: ${{ steps.get_version.outputs.buildname }}
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
-
|
||||
name: Checkout repository
|
||||
uses: actions/checkout@v1
|
||||
-
|
||||
name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
if [ -z "$version" ]
|
||||
then
|
||||
version=$(date '+%Y%m%d')
|
||||
echo ::set-output name=version::"${version}"
|
||||
else
|
||||
echo ::set-output name=version::"${version}"
|
||||
fi
|
||||
builddate=$(date '+%Y-%m-%d')
|
||||
buildhash=$(git rev-parse --short "$GITHUB_SHA")
|
||||
buildname="${builddate}-${buildhash}"
|
||||
echo ::set-output name=version::${VERSION}
|
||||
echo ::set-output name=buildhash::${buildhash}
|
||||
echo ::set-output name=builddate::${builddate}
|
||||
echo ::set-output name=buildname::${buildname}
|
||||
env:
|
||||
version: ${{ github.event.inputs.version }}
|
||||
compile:
|
||||
runs-on: ${{ matrix.host }}
|
||||
needs: [ version ]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 3
|
||||
|
@ -46,6 +76,82 @@ jobs:
|
|||
id: upload_deploy
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ steps.get-artifact-name.outputs.artifact_filename }}
|
||||
name: ${{ matrix.config.arch }}
|
||||
path: |
|
||||
${{ steps.get-artifact-name.outputs.artifact_path }}
|
||||
# Create Release
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ version, compile ]
|
||||
name: 'Create release'
|
||||
outputs:
|
||||
release_upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||
steps:
|
||||
-
|
||||
name: Build Changelog
|
||||
id: github_release
|
||||
uses: mikepenz/release-changelog-builder-action@v2.4.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Create GitHub release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1.0.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{needs.version.outputs.version }}
|
||||
release_name: ${{needs.version.outputs.buildname }}
|
||||
body: ${{steps.github_release.outputs.changelog}}
|
||||
draft: true
|
||||
prerelease: true
|
||||
# Upload release artifacts
|
||||
upload:
|
||||
needs: [ version, compile, release ]
|
||||
runs-on: ${{ matrix.host }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 3
|
||||
matrix:
|
||||
host: [
|
||||
"ubuntu-latest",
|
||||
#"macos-10.15",
|
||||
]
|
||||
config:
|
||||
- {
|
||||
name: "armhf Release",
|
||||
arch: "armhf"
|
||||
}
|
||||
- {
|
||||
name: "amd64 Release",
|
||||
arch: "amd64"
|
||||
}
|
||||
|
||||
name: 'Upload release: ${{ matrix.config.name }}'
|
||||
steps:
|
||||
-
|
||||
name: Download build artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ steps.get_version.outputs.version }}
|
||||
|
||||
-
|
||||
name: Get Artifact Filenames
|
||||
id: get-artifact-name
|
||||
run: |
|
||||
ARTIFACT_PATHNAME=$(ls ${{ matrix.config.arch }}/*.deb | head -n 1)
|
||||
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
|
||||
echo ::set-output name=ARTIFACT_NAME::"${ARTIFACT_NAME}"
|
||||
echo ::set-output name=ARTIFACT_PATHNAME::"${ARTIFACT_PATHNAME}"
|
||||
-
|
||||
name: Upload zip to release
|
||||
id: upload_zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RELEASE_VERSION: ${{ needs.version.outputs.buildname }}
|
||||
with:
|
||||
upload_url: ${{needs.release.outputs.release_upload_url}}
|
||||
asset_path: ${{ steps.get-artifact-name.outputs.artifact_path }}
|
||||
asset_name: ${{ steps.get-artifact-name.outputs.artifact_filename }}
|
||||
asset_content_type: application/vnd.debian.binary-package
|
||||
|
|
Loading…
Reference in New Issue