|
6 | 6 | - uses: actions/checkout@v2
|
7 | 7 | - name: Build packages for linux/arm64 platform
|
8 | 8 | run: |
|
9 |
| - |
| 9 | +
|
10 | 10 | # Enable an execution of different multi-architecture containers by QEMU
|
11 | 11 | sudo apt-get update -y
|
12 |
| - sudo apt-get install -y qemu qemu-user-static |
| 12 | + sudo apt-get install -y qemu qemu-user-static |
13 | 13 | docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
14 | 14 |
|
15 | 15 | # Build packages on aarch64 architecture
|
|
30 | 30 | cp build/deb/*.deb /artifacts && \
|
31 | 31 | cp build/rpm/*.rpm /artifacts && \
|
32 | 32 | rm -rf build"
|
| 33 | +
|
33 | 34 | - name: Build packages for linux/amd64 platform
|
34 | 35 | run: |
|
35 | 36 | sudo apt-get install -y rpm
|
|
38 | 39 | make rpm
|
39 | 40 | sudo cp build/deb/*.deb ${PWD}/artifacts
|
40 | 41 | sudo cp build/rpm/*.rpm ${PWD}/artifacts
|
| 42 | +
|
41 | 43 | - name: Deploy
|
42 | 44 | if: ${{ github.ref == 'refs/heads/main' }}
|
43 | 45 | run: |
|
|
55 | 57 | done
|
56 | 58 | env:
|
57 | 59 | PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
|
| 60 | + |
| 61 | + - name: Extract version from Makefile |
| 62 | + id: make_version |
| 63 | + run: | |
| 64 | + echo ::set-output name=version::$(make version) |
| 65 | +
|
| 66 | + - name: Create Tag |
| 67 | + uses: actions/github-script@v6 |
| 68 | + with: |
| 69 | + github-token: ${{ github.token }} |
| 70 | + script: | |
| 71 | + try { |
| 72 | + await github.rest.git.updateRef({ |
| 73 | + owner: context.repo.owner, |
| 74 | + repo: context.repo.repo, |
| 75 | + ref: "tags/v${{ steps.make_version.outputs.version }}", |
| 76 | + sha: context.sha, |
| 77 | + force: true |
| 78 | + }) |
| 79 | + } catch (e) { |
| 80 | + await github.rest.git.createRef({ |
| 81 | + owner: context.repo.owner, |
| 82 | + repo: context.repo.repo, |
| 83 | + ref: "refs/tags/v${{ steps.make_version.outputs.version }}", |
| 84 | + sha: context.sha |
| 85 | + }) |
| 86 | + } |
| 87 | +
|
| 88 | + - name: Create Release |
| 89 | + run: | |
| 90 | + curl \ |
| 91 | + -X POST \ |
| 92 | + -H "Accept: application/vnd.github+json" \ |
| 93 | + -H "Authorization: token ${{ secrets.GH_RELEASE_TOKEN }}" \ |
| 94 | + https://api.github.com/repos/${GITHUB_REPOSITORY}/releases \ |
| 95 | + -d '{"tag_name":"v${{ steps.make_version.outputs.version }}","target_commitish":"${{ github.sha }}","name":"v${{ steps.make_version.outputs.version }}","body":"${{ github.event.head_commit.message }}","draft":false,"prerelease":false,"generate_release_notes":false}' |
0 commit comments