Skip to content

Commit 87d6b11

Browse files
authored
Update build.yml
1 parent 922d1c0 commit 87d6b11

File tree

1 file changed

+12
-57
lines changed

1 file changed

+12
-57
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,25 @@
11
name: Build and Release
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
branches:
6+
- '**'
67

78
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:
3310
runs-on: ubuntu-latest
3411
steps:
35-
- name: Checkout repository
12+
- name: Checkout Code
3613
uses: actions/checkout@v3
3714

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
5117

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
5620
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
6424
env:
6525
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

Comments
 (0)