|
1 | | -on: |
| 1 | +on: |
2 | 2 | push: |
3 | | - branches: |
4 | | - - main |
| 3 | + # Sequence of patterns matched against refs/tags |
| 4 | + tags: |
| 5 | + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 6 | + |
| 7 | +name: Upload Release Asset |
5 | 8 |
|
6 | 9 | jobs: |
7 | | - release-on-push: |
| 10 | + build: |
| 11 | + name: Upload Release Asset |
8 | 12 | runs-on: ubuntu-latest |
9 | | - env: |
10 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
11 | 13 | steps: |
12 | | - - uses: actions/checkout@v2 |
13 | | -# - name: Build |
14 | | -# run: cargo build --release |
15 | | - - name: Upload binaries to release |
16 | | - uses: svenstaro/upload-release-action@v2 |
| 14 | + - name: Checkout code |
| 15 | + uses: actions/checkout@v2 |
| 16 | + - name: Build project # This would actually build your project, using zip for an example artifact |
| 17 | + run: | |
| 18 | + zip --junk-paths my-artifact README.md |
| 19 | + - name: Create Release |
| 20 | + id: create_release |
| 21 | + uses: actions/create-release@v1 |
| 22 | + env: |
| 23 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
17 | 24 | with: |
18 | | - repo_token: ${{ secrets.GITHUB_TOKEN }} |
19 | | - file: target/release/resume/*.pdf |
20 | | - overwirte: true |
21 | | -# asset_name: drewyang_dev_resume |
22 | | - tag: ${{ github.ref }} |
23 | | -# overwrite: true |
24 | | -# body: "This is my release text" |
25 | | - |
26 | | - - id: release |
27 | | - uses: rymndhng/release-on-push-action@master |
| 25 | + tag_name: ${{ github.ref }} |
| 26 | + release_name: Release ${{ github.ref }} |
| 27 | + draft: false |
| 28 | + prerelease: false |
| 29 | + - name: Upload Release Asset |
| 30 | + id: upload-release-asset |
| 31 | + uses: actions/upload-release-asset@v1 |
| 32 | + env: |
| 33 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
28 | 34 | with: |
29 | | - bump_version_scheme: minor |
30 | | - tag_prefix: v |
31 | | - - name: Check Output Parameters |
32 | | - run: | |
33 | | - echo "Got tag name ${{ steps.release.outputs.tag_name }}" |
34 | | - echo "Got release version ${{ steps.release.outputs.version }}" |
| 35 | + 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 |
| 36 | + asset_path: ./my-artifact.zip |
| 37 | + asset_name: my-artifact.zip |
| 38 | + asset_content_type: application/zip |
0 commit comments