-
Notifications
You must be signed in to change notification settings - Fork 105
76 lines (73 loc) · 2.08 KB
/
pull_request.yaml
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
name: pull_request
on:
push:
branches:
- 'master'
pull_request: {}
release:
types: [published]
jobs:
build:
if: ${{! github.event.release.tag_name}}
name: build-works
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Go 1.18
uses: actions/[email protected]
with:
go-version: '1.18.0-rc.1'
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Acceptance test
run: |
curl -sSL -O https://releases.hashicorp.com/packer/1.7.7/packer_1.7.7_linux_amd64.zip
unzip packer_1.7.7_linux_amd64.zip
mv packer /usr/local/bin/packer
rm packer_1.7.7_linux_amd64.zip
# make packer
make install-local
make testacc-sudo
- name: Failed acceptance
if: ${{ failure() }}
run: |
echo pkg/builder/packer_log_image-arm-builder_basic_test.txt
cat pkg/builder/packer_log_image-arm-builder_basic_test.txt
echo
echo packer-plugin-arm-image/pkg/builder/image-arm-builder_basic_test.pkr.hcl
cat packer-plugin-arm-image/pkg/builder/image-arm-builder_basic_test.pkr.hcl
- name: Go releaser
run: |
make release-snapshot
- name: docker
run: |
go build -ldflags="-s -w" -o packer-plugin-arm-image .
docker build .
docker build -f Dockerfile.release .
release:
name: release
runs-on: ubuntu-18.04
if: github.event.release.tag_name
env:
TAGGED_VERSION: ${{github.event.release.tag_name}}
steps:
- uses: actions/checkout@v2
- name: Set up Go 1.18
uses: actions/[email protected]
with:
go-version: '1.18.0-rc.1'
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Go releaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
make release