Merge pull request #291 from caiom/fix_windows_dongle #88
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish source | |
on: | |
push: | |
release: | |
types: | |
- created | |
jobs: | |
gather-source: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Set bundle name | |
id: bundle | |
working-directory: ${{runner.workspace}}/libsurvive | |
run: echo "::set-output name=BUNDLE_FILE_NAME::libsurvive-$(git describe --tags)-source.zip" | |
- name: Generate version | |
working-directory: ${{runner.workspace}}/libsurvive | |
run: git describe --dirty --tags > VERSION | |
- name: Remove git directories | |
working-directory: ${{runner.workspace}}/libsurvive | |
run: rm -rf .git | |
- name: Get release | |
id: get_release | |
if: github.event_name == 'release' | |
uses: bruceadams/get-release@v1.2.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Bundle | |
working-directory: ${{runner.workspace}}/libsurvive | |
run: 7z a ${{runner.workspace}}/${{ steps.bundle.outputs.BUNDLE_FILE_NAME }} ${{runner.workspace}}/libsurvive | |
- uses: actions/upload-artifact@v2 | |
name: Upload | |
with: | |
name: ${{ steps.bundle.outputs.BUNDLE_FILE_NAME }} | |
path: ${{runner.workspace}} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
continue-on-error: true | |
if: github.event_name == 'release' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ${{runner.workspace}}/${{steps.bundle.outputs.BUNDLE_FILE_NAME}} | |
asset_name: ${{steps.bundle.outputs.BUNDLE_FILE_NAME}} | |
asset_content_type: application/zip |