2020-05-15 00:14:51 +00:00
name : BuildRelease
on :
push :
branches :
- master
jobs :
build :
2020-05-15 23:47:08 +00:00
2020-05-15 00:14:51 +00:00
runs-on : ubuntu-latest
2020-05-15 23:47:08 +00:00
2020-05-15 00:14:51 +00:00
steps :
- uses : actions/checkout@v2
2020-05-15 23:47:08 +00:00
- name : Increment version
run : |
echo ::set-env name=TAG_NAME::$(cat ./VERSION)
- name : Bump release version
id : bump_version
uses : christian-draeger/increment-semantic-version@1.0.1
with :
current-version : '${{ env.TAG_NAME }}'
version-fragment : 'feature'
2020-05-15 00:14:51 +00:00
- name : Set up Python 3.8
uses : actions/setup-python@v1
with :
2020-05-15 03:10:40 +00:00
python-version : 3.8 .2
2020-05-15 23:47:08 +00:00
2020-05-15 00:14:51 +00:00
- name : Install dependencies
run : |
2020-05-15 03:28:12 +00:00
if [ -f ./builder/requirements.txt ]; then pip3 install -r ./builder/requirements.txt; fi
2020-05-15 23:47:08 +00:00
2020-05-15 01:55:31 +00:00
- name : Create config script
env :
gitPass : ${{ secrets.SLX_GIT_PASS }}
gitToken : ${{ secrets.SLX_GIT_TOKEN }}
gitUser : ${{ secrets.SLX_GIT_USER }}
run : |
2020-05-15 23:47:08 +00:00
echo -e "version = 'v${{ steps.bump_version.outputs.next-version }}'\ngithub_username = '$gitUser'\ngithub_password = '$gitPass'\ngitlab_private_access_token = '$gitToken'"> ./builder/config.py
2020-05-15 00:14:51 +00:00
- name : Compile DeepSea Zip
run : |
2020-05-15 02:32:57 +00:00
cd ./builder
2020-05-15 23:47:08 +00:00
python ./builder.py deepsea output="./deepsea.zip"
2020-05-15 00:14:51 +00:00
- name : Compile DeepSea-minimal Zip
run : |
2020-05-15 03:39:04 +00:00
cd ./builder
2020-05-15 23:47:08 +00:00
python ./builder.py deepsea-mini output="./deepsea-minimal.zip"
2020-05-15 00:32:14 +00:00
- name : Create Release
id : create_release
uses : actions/create-release@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
2020-05-15 23:47:08 +00:00
tag_name : v${{ steps.bump_version.outputs.next-version }}
release_name : Release ${{ steps.bump_version.outputs.next-version }}
2020-05-15 00:32:14 +00:00
draft : true
prerelease : false
2020-05-15 23:47:08 +00:00
2020-05-15 00:32:14 +00:00
- name : Upload Release Asset - DeepSea
id : upload-release-asset
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
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
2020-05-15 00:54:08 +00:00
asset_path : ./builder/deepsea.zip
2020-05-15 23:47:08 +00:00
asset_name : deepsea_v${{ steps.bump_version.outputs.next-version }}.zip
2020-05-15 00:32:14 +00:00
asset_content_type : application/zip
2020-05-15 23:47:08 +00:00
2020-05-15 00:32:14 +00:00
- name : Upload Release Asset - DeepSea-Minimal
id : upload-release-asset2
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
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
2020-05-15 03:44:32 +00:00
asset_path : ./builder/deepsea-minimal.zip
2020-05-15 23:47:08 +00:00
asset_name : deepsea-minimal_v${{ steps.bump_version.outputs.next-version }}.zip
2020-05-15 00:32:14 +00:00
asset_content_type : application/zip
2020-05-15 23:47:08 +00:00
- name : Clean workspace
run : |
rm -rf ./build/*.zip
rm -rf ./build/config.py
- name : Bump VERSION
run : |
echo ${{ steps.bump_version.outputs.next-version }} > ./VERSION
- name : Commit files
run : |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "[Auto] bump push after build" -a
- name : Push changes
uses : ad-m/github-push-action@master
with :
github_token : ${{ secrets.GITHUB_TOKEN }}