|
1 | 1 | name: Build and Release
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - release: |
5 |
| - types: [published] |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '**' |
6 | 7 |
|
7 | 8 | jobs:
|
8 |
| - build: |
9 |
| - runs-on: ${{ matrix.os }} |
10 |
| - strategy: |
11 |
| - matrix: |
12 |
| - os: [ubuntu-latest, macos-latest] |
13 |
| - |
14 |
| - steps: |
15 |
| - - name: Checkout repository |
16 |
| - uses: actions/checkout@v3 |
17 |
| - |
18 |
| - - name: Build mbox2eml |
19 |
| - run: | |
20 |
| - mkdir -p build |
21 |
| - make |
22 |
| - cp mbox2eml build/mbox2eml |
23 |
| - shell: bash |
24 |
| - |
25 |
| - - name: Upload binary artifact |
26 |
| - uses: actions/upload-artifact@v3 |
27 |
| - with: |
28 |
| - name: mbox2eml-${{ matrix.os }} |
29 |
| - path: build/mbox2eml |
30 |
| - |
31 |
| - release: |
32 |
| - needs: build |
| 9 | + build_and_release: |
33 | 10 | runs-on: ubuntu-latest
|
34 | 11 | steps:
|
35 |
| - - name: Checkout repository |
| 12 | + - name: Checkout Code |
36 | 13 | uses: actions/checkout@v3
|
37 | 14 |
|
38 |
| - - name: Download binaries |
39 |
| - uses: actions/download-artifact@v3 |
40 |
| - with: |
41 |
| - name: mbox2eml-ubuntu-latest |
42 |
| - path: mbox2eml-ubuntu-latest |
43 |
| - |
44 |
| - - name: Download binaries for macOS |
45 |
| - uses: actions/download-artifact@v3 |
46 |
| - with: |
47 |
| - name: mbox2eml-macos-latest |
48 |
| - path: mbox2eml-macos-latest |
49 |
| - |
50 |
| - |
| 15 | + - name: Build |
| 16 | + run: make |
51 | 17 |
|
52 |
| - - name: Upload Release Asset for Linux |
53 |
| - uses: actions/upload-release-asset@v1 |
54 |
| - env: |
55 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + - name: Create Release |
| 19 | + uses: softprops/action-gh-release@v1 |
56 | 20 | with:
|
57 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
58 |
| - asset_path: mbox2eml-ubuntu-latest/mbox2eml |
59 |
| - asset_name: mbox2eml-linux |
60 |
| - asset_content_type: application/octet-stream |
61 |
| - |
62 |
| - - name: Upload Release Asset for macOS |
63 |
| - uses: actions/upload-release-asset@v1 |
| 21 | + tag_name: 'build-${{ github.run_number }}' |
| 22 | + release_name: 'Build ${{ github.run_number }}' |
| 23 | + files: 'mbox2eml' # Replace 'myprogram' with your binary's name |
64 | 24 | env:
|
65 | 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
66 |
| - with: |
67 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
68 |
| - asset_path: mbox2eml-macos-latest/mbox2eml |
69 |
| - asset_name: mbox2eml-macos |
70 |
| - asset_content_type: application/octet-stream |
0 commit comments