|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "[0-9]+.[0-9]+.[0-9]*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + deploy: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + with: |
| 14 | + fetch-depth: 0 |
| 15 | + - name: Set env |
| 16 | + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV |
| 17 | + - name: Set up Python |
| 18 | + uses: actions/setup-python@v2 |
| 19 | + with: |
| 20 | + python-version: 3.8 |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + python -m pip install --upgrade pip |
| 24 | + pip install git+https://github.com/inettgmbh/python-mkp.git@0.6 |
| 25 | + - name: Build |
| 26 | + run: | |
| 27 | + chmod +x build/mkp-pack build/update-version |
| 28 | + build/update-version ${{ env.RELEASE_VERSION }} |
| 29 | + build/mkp-pack |
| 30 | + - name: Create Release |
| 31 | + id: create_release |
| 32 | + uses: actions/create-release@v1 |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + with: |
| 36 | + tag_name: ${{ github.ref }} |
| 37 | + release_name: Release ${{ github.ref }} |
| 38 | + draft: false |
| 39 | + prerelease: false |
| 40 | + - name: Upload a Build Artifact |
| 41 | + uses: actions/upload-artifact@v2.2.3 |
| 42 | + with: |
| 43 | + # Artifact name |
| 44 | + name: mkp-package |
| 45 | + # A file, directory or wildcard pattern that describes what to upload |
| 46 | + path: "*.mkp" |
| 47 | + # The desired behavior if no files are found using the provided path. |
| 48 | + - name: Upload Release Asset |
| 49 | + id: upload-release-asset |
| 50 | + uses: actions/upload-release-asset@v1 |
| 51 | + env: |
| 52 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + with: |
| 54 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 55 | + asset_path: proxmox_bs-${{ env.RELEASE_VERSION }}.mkp |
| 56 | + asset_name: proxmox_bs-${{ env.RELEASE_VERSION }}.mkp |
| 57 | + asset_content_type: application/gzip |
0 commit comments