diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a321647..96e22e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,26 +1,66 @@ -name: "tagged-release" +name: ThingiZIP Release on: push: - branches: - - main + # Sequence of patterns matched against refs/tags tags: - - "v*" - + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 jobs: - tagged-release: - name: "Tagged Release" - runs-on: "ubuntu-latest" - + build: + runs-on: ubuntu-latest + name: Build steps: - - name: "Build & test" + - name: Checkout + uses: actions/checkout@v2 + - name: Build run: cd build && ./build.sh - - uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false prerelease: false - files: | - cd build/output - *.zip - *.crx - *.xpi \ No newline at end of file + - name: Upload Chrome ZIP Asset + id: upload-chrome-zip-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 + asset_path: ./output/ThingiZIP-chrome.zip + asset_name: ThingiZIP-chrome.zip + asset_content_type: application/zip + - name: Upload Chrome CRX Asset + id: upload-chrome-crx-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 + asset_path: ./output/ThingiZIP-chrome.crx + asset_name: ThingiZIP-chrome.crx + asset_content_type: application/zip + - name: Upload Firefox ZIP Asset + id: upload-firefox-zip-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 + asset_path: ./output/ThingiZIP-firefox.zip + asset_name: ThingiZIP-firefox.zip + asset_content_type: application/zip + - name: Upload Chrome XPI Asset + id: upload-firefox-xpi-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 + asset_path: ./output/ThingiZIP-firefox.xpi + asset_name: ThingiZIP-firefox.xpi + asset_content_type: application/zip