|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v[0-9]+.[0-9]+.[0-9]+*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + create-release-artifacts: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v1 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + |
| 18 | + - name: Install Taskfile |
| 19 | + uses: arduino/actions/setup-taskfile@master |
| 20 | + with: |
| 21 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 22 | + version: 3.x |
| 23 | + |
| 24 | + - name: Build |
| 25 | + run: task dist:all |
| 26 | + |
| 27 | + - name: Upload artifacts |
| 28 | + uses: actions/upload-artifact@v2 |
| 29 | + with: |
| 30 | + name: dist |
| 31 | + path: dist |
| 32 | + |
| 33 | + create-release: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + needs: create-release-artifacts |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Checkout |
| 39 | + uses: actions/checkout@v2 |
| 40 | + |
| 41 | + - name: Download artifact |
| 42 | + uses: actions/download-artifact@v2 |
| 43 | + with: |
| 44 | + name: dist |
| 45 | + # to ensure compatibility with v1 |
| 46 | + path: dist |
| 47 | + |
| 48 | + - name: Create Github Release |
| 49 | + id: create_release |
| 50 | + uses: actions/create-release@v1 |
| 51 | + env: |
| 52 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + with: |
| 54 | + tag_name: ${{ github.ref }} |
| 55 | + release_name: ${{ github.ref }} |
| 56 | + body: Release ${{ github.ref }} |
| 57 | + draft: false |
| 58 | + |
| 59 | + - name: Upload release files on Github |
| 60 | + uses: svenstaro/upload-release-action@v2 |
| 61 | + with: |
| 62 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + file: dist/* |
| 64 | + tag: ${{ github.ref }} |
| 65 | + file_glob: true |
| 66 | +# |
| 67 | +# - name: Upload release files on Arduino downloads servers |
| 68 | +# uses: docker://plugins/s3 |
| 69 | +# env: |
| 70 | +# PLUGIN_SOURCE: "dist/*" |
| 71 | +# PLUGIN_TARGET: "/tools/" |
| 72 | +# PLUGIN_STRIP_PREFIX: "dist/" |
| 73 | +# PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} |
| 74 | +# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 75 | +# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
0 commit comments