diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 568b200..75103d8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: push: branches: - release* + - main tags: - v* pull_request: @@ -96,10 +97,11 @@ jobs: needs: - run-x86_64 - run-arm64 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') || github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - name: Create Release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') id: create_release uses: actions/create-release@v1 with: @@ -110,6 +112,18 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Pre-Release + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + id: create_pre_release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref }} + release_name: Pre-Release + draft: false + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/download-artifact@v3 with: name: home-cli-pack-x86_64 @@ -120,7 +134,18 @@ jobs: 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 + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./home-cli-x86_64.tar + asset_name: home-cli-x86_64.tar + asset_content_type: application/tar + + - name: Upload Pre-Release Assets x86_64 + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_pre_release.outputs.upload_url }} asset_path: ./home-cli-x86_64.tar asset_name: home-cli-x86_64.tar asset_content_type: application/tar @@ -135,7 +160,18 @@ jobs: 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 + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./home-cli-arm64.tar + asset_name: home-cli-arm64.tar + asset_content_type: application/tar + + - name: Upload Pre-Release Assets arm64 + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_pre_release.outputs.upload_url }} asset_path: ./home-cli-arm64.tar asset_name: home-cli-arm64.tar asset_content_type: application/tar