diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c5d99d..5d564ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,70 +1,25 @@ name: Build and Release on: - release: - types: [published] + push: + branches: + - '**' jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Build mbox2eml - run: | - mkdir -p build - make - cp mbox2eml build/mbox2eml - shell: bash - - - name: Upload binary artifact - uses: actions/upload-artifact@v3 - with: - name: mbox2eml-${{ matrix.os }} - path: build/mbox2eml - - release: - needs: build + build_and_release: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout Code uses: actions/checkout@v3 - - name: Download binaries - uses: actions/download-artifact@v3 - with: - name: mbox2eml-ubuntu-latest - path: mbox2eml-ubuntu-latest - - - name: Download binaries for macOS - uses: actions/download-artifact@v3 - with: - name: mbox2eml-macos-latest - path: mbox2eml-macos-latest - - + - name: Build + run: make - - name: Upload Release Asset for Linux - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Release + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: mbox2eml-ubuntu-latest/mbox2eml - asset_name: mbox2eml-linux - asset_content_type: application/octet-stream - - - name: Upload Release Asset for macOS - uses: actions/upload-release-asset@v1 + tag_name: 'build-${{ github.run_number }}' + release_name: 'Build ${{ github.run_number }}' + files: 'mbox2eml' # Replace 'myprogram' with your binary's name env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: mbox2eml-macos-latest/mbox2eml - asset_name: mbox2eml-macos - asset_content_type: application/octet-stream