-
Notifications
You must be signed in to change notification settings - Fork 2
104 lines (93 loc) · 4.17 KB
/
releasebuild.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: "tagged-release"
on:
push:
tags:
- "v*"
jobs:
tagged-release:
name: "ReleaseBuild"
runs-on: "ubuntu-latest"
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
permissions:
# required for all workflows
security-events: read
actions: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: "Build"
run: |
bash scripts/build-all-arch.sh
working-directory: "."
- name: "Test"
id: "test"
# only testing amd64 and 386 builds, as the github machine do not support others
run: |
set -e
sudo apt-get install -y buildah
for exe in devc-v*amd64 devc-v*386 ; do echo -e "\nTesting $exe"; if ! ./$exe --version ; then echo "Error executing : $exe" ; exit 1; fi; done ;
working-directory: "."
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: false
prerelease: false
if: steps.test.outputs.exit_code == 0
- name: Upload Release Asset 386
id: upload-release-asset-386
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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
asset_path: ./devc-${{ github.ref_name }}-linux-386
asset_name: devc-${{ github.ref_name }}-linux-386
asset_content_type: binary/octet-stream
- name: Upload Release Asset amd64
id: upload-release-asset-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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
asset_path: ./devc-${{ github.ref_name }}-linux-amd64
asset_name: devc-${{ github.ref_name }}-amd64
asset_content_type: binary/octet-stream
- name: Upload Release Asset arm
id: upload-release-asset-arm
uses: actions/upload-release-asset@v1
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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
asset_path: ./devc-${{ github.ref_name }}-linux-arm
asset_name: devc-${{ github.ref_name }}-arm
asset_content_type: binary/octet-stream
- name: Upload Release Asset arm64
id: upload-release-asset-arm64
uses: actions/upload-release-asset@v1
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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
asset_path: ./devc-${{ github.ref_name }}-linux-arm64
asset_name: devc-${{ github.ref_name }}-arm64
asset_content_type: binary/octet-stream