Merge pull request #68 from xrobot-org/dev #18
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: pack_repo | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master" ] | |
paths: | |
- '**.gitmodules' | |
jobs: | |
Pack: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/xrobot-org/docker-image:main | |
options: --user 0 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Init submodule | |
run: git config --global --add safe.directory /__w/XRobot/XRobot && git submodule init && git submodule update | |
- name: Pack repo | |
run: zip -r repo.zip ./ | |
- name: Create release | |
run: echo "release_name=repo.$(date +v%Y.%m.%d.vv%H.%M)" >> $GITHUB_ENV | |
- uses: actions/create-release@v1 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.release_name }} | |
release_name: Repo ${{ env.release_name }} | |
draft: false | |
prerelease: false | |
- name: Upload repo | |
uses: actions/upload-release-asset@v1 | |
id: upload-repo | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{github.workspace}}/repo.zip | |
asset_name: repo.zip | |
asset_content_type: application/zip |