|
1 | | -name: Release |
2 | | - |
3 | 1 | on: |
4 | | - release: |
5 | | - types: [released] |
6 | | - |
7 | | - # Allows you to run this workflow manually from the Actions tab |
8 | | - workflow_dispatch: |
9 | | - |
| 2 | + push: |
| 3 | + # Pattern matched against refs/tags |
| 4 | + tags: |
| 5 | + - '*' # Push events to every tag not containing / |
| 6 | +name: Create Release Binaries |
10 | 7 | jobs: |
11 | | - binaries: |
12 | | - name: Build release binaries. |
| 8 | + generate: |
| 9 | + name: Create release-artifacts |
13 | 10 | runs-on: ubuntu-latest |
14 | | - |
15 | 11 | steps: |
16 | | - - uses: actions/checkout@v2 |
17 | | - - uses: actions/setup-node@v3 |
18 | | - |
19 | | - - name: Install yarn. |
20 | | - run: npm install -g yarn |
21 | | - - name: Install dependencies. |
22 | | - run: yarn install |
23 | | - - name: Build. |
24 | | - run: yarn build:binaries |
25 | | - |
26 | | - - uses: actions/upload-artifact@v3 |
| 12 | + - name: Checkout the repository |
| 13 | + uses: actions/checkout@main |
| 14 | + - name: Build Binaries |
| 15 | + run: | |
| 16 | + yarn install |
| 17 | + yarn build |
| 18 | + yarn build:binaries |
| 19 | + cd out |
| 20 | + zip kyve-linux.zip kyve-linux |
| 21 | + rm kyve-linux |
| 22 | + zip kyve-macos.zip kyve-macos |
| 23 | + rm kyve-macos |
| 24 | + cd .. |
| 25 | + - name: Generate Changelog |
| 26 | + id: github_release |
| 27 | + uses: mikepenz/release-changelog-builder-action@v3 |
27 | 28 | with: |
28 | | - name: kyve-bitcoin-linux |
29 | | - path: ./out/bitcoin-linux |
30 | | - - uses: actions/upload-artifact@v3 |
| 29 | + configuration: ".github/workflows/configuration.json" |
| 30 | + commitMode: true |
| 31 | + env: |
| 32 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + - name: Publish the Release |
| 34 | + uses: softprops/action-gh-release@v1 |
31 | 35 | with: |
32 | | - name: kyve-bitcoin-macos |
33 | | - path: ./out/bitcoin-macos |
34 | | - - uses: actions/upload-artifact@v3 |
35 | | - with: |
36 | | - name: kyve-bitcoin-win.exe |
37 | | - path: ./out/bitcoin-win.exe |
38 | | - |
39 | | - docker: |
40 | | - name: Build and publish Docker container. |
41 | | - runs-on: ubuntu-latest |
42 | | - |
43 | | - steps: |
44 | | - - uses: actions/checkout@v2 |
45 | | - |
46 | | - - name: Login to Docker. |
47 | | - run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} |
48 | | - |
49 | | - - name: Build the Docker image. |
50 | | - run: docker build -t kyve/bitcoin:${GITHUB_REF#refs/tags/} -t kyve/bitcoin:latest . |
51 | | - |
52 | | - - name: Push to Docker hub. |
53 | | - run: docker push -a kyve/bitcoin |
54 | | - |
55 | | - webhook: |
56 | | - name: Post a message to Discord. |
57 | | - needs: [binaries, docker] |
58 | | - runs-on: ubuntu-latest |
59 | | - |
60 | | - steps: |
61 | | - - uses: actions/checkout@v2 |
62 | | - - uses: actions/setup-node@v3 |
63 | | - |
64 | | - - name: Install yarn. |
65 | | - run: npm install -g yarn |
66 | | - - name: Install dependencies. |
67 | | - run: yarn install |
68 | | - |
69 | | - - name: Run script. |
70 | | - run: DISCORD=${{ secrets.DISCORD }} VERSION=${GITHUB_REF#refs/tags/} node .github/webhook.js |
| 36 | + body: ${{steps.github_release.outputs.changelog}} |
| 37 | + tag_name: ${{ steps.vars.outputs.tag_name }} |
| 38 | + files: out/* |
| 39 | + prerelease: false |
| 40 | + env: |
| 41 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments