This repository was archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
118 lines (113 loc) · 5.33 KB
/
Copy pathdev-release.yml
File metadata and controls
118 lines (113 loc) · 5.33 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Dev-Release
on:
push:
branches-ignore:
- master
jobs:
dev-release:
name: Dev-Release ORBOS
runs-on: ubuntu-18.04
steps:
- name: Source Checkout Dev
id: source-checkout-dev
uses: actions/checkout@v1
- uses: actions/setup-go@v2
with:
go-version: '1.16.0'
- name: Dev-Release
id: dev-release
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: on
CGO_ENABLED: 0
CR_PAT: ${{ secrets.CR_PAT }}
REGISTRY: ghcr.io
run: |
export VERSION=${GITHUB_REF##*/}-dev
echo "::set-output name=version::$VERSION"
export IMAGE=$REGISTRY/$GITHUB_REPOSITORY
export TAG_VERSION=${IMAGE}:${VERSION}
go mod download
mkdir -p ./artifacts
go run cmd/chore/gen-executables/*.go -version "$VERSION" -commit "${{ github.sha }}" -githubclientid "${{ secrets.GITHUBOAUTHCLIENTID }}" -githubclientsecret "${{ secrets.GITHUBOAUTHCLIENTSECRET }}" --orbctl ./artifacts
CGO_ENABLED=0 GOOS=linux go build -o ./artifacts/gen-charts cmd/chore/gen-charts/*.go
echo "Publishing ORBOS dev-version $VERSION"
docker login $REGISTRY -u $GITHUB_ACTOR -p $CR_PAT
docker build --tag ${TAG_VERSION} --file ./build/orbos/Dockerfile .
docker push ${TAG_VERSION}
echo "##[set-output name=relbranch;]$(echo ${VERSION})"
curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/caos/orbos/releases/$(echo $(curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/caos/orbos/releases/tags/${VERSION} | jq .id))
- name: Dev Release Create
id: dev-release-create
uses: actions/create-release@v1
if: steps.dev-release.outputs.relbranch != null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.dev-release.outputs.relbranch }}
release_name: Branch ${{ steps.dev-release.outputs.relbranch }}
body: |
This is a release from a development branch.
Do not use these artifacts in production.
draft: false
prerelease: true
- name: Upload Darwin Dev Release Asset
uses: actions/upload-release-asset@v1.0.1
if: steps.dev-release.outputs.relbranch != null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.dev-release-create.outputs.upload_url }}
asset_path: ./artifacts/orbctl-Darwin-x86_64
asset_name: orbctl Darwin x86_64
asset_content_type: application/octet-stream
- name: Upload FreeBSD Dev Release Asset
if: steps.dev-release.outputs.relbranch != null
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.dev-release-create.outputs.upload_url }}
asset_path: ./artifacts/orbctl-FreeBSD-x86_64
asset_name: orbctl FreeBSD x86_64
asset_content_type: application/octet-stream
- name: Upload Linux Dev Release Asset
if: steps.dev-release.outputs.relbranch != null
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.dev-release-create.outputs.upload_url }}
asset_path: ./artifacts/orbctl-Linux-x86_64
asset_name: orbctl Linux x86_64
asset_content_type: application/octet-stream
- name: Upload OpenBSD Dev Release Asset
if: steps.dev-release.outputs.relbranch != null
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.dev-release-create.outputs.upload_url }}
asset_path: ./artifacts/orbctl-OpenBSD-x86_64
asset_name: orbctl OpenBSD x86_64
asset_content_type: application/octet-stream
- name: Upload Windows Dev Release Asset
if: steps.dev-release.outputs.relbranch != null
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.dev-release-create.outputs.upload_url }}
asset_path: ./artifacts/orbctl-Windows-x86_64.exe
asset_name: orbctl Windows x86_64
asset_content_type: application/octet-stream
# - name: Trigger E2E Test On StaticProvider
# if: steps.dev-release.outputs.relbranch != null
# run: go run ./cmd/chore/e2e/trigger/*.go --branch "${GITHUB_REF#refs/heads/}" --organization caos --repository ORBOS-Test-StaticProvider --access-token "${{ secrets.CR_PAT }}"
# - name: Trigger E2E Test On GCEProvider
# if: steps.dev-release.outputs.relbranch != null
# run: go run ./cmd/chore/e2e/trigger/*.go --branch "${GITHUB_REF#refs/heads/}" --organization caos --repository ORBOS-Test-GCEProvider --access-token "${{ secrets.CR_PAT }}"
# - name: Trigger E2E Test On CloudscaleProvider
# if: steps.dev-release.outputs.relbranch != null
# run: go run ./cmd/chore/e2e/trigger/*.go --branch "${GITHUB_REF#refs/heads/}" --organization caos --repository ORBOS-Test-CloudscaleProvider --access-token "${{ secrets.CR_PAT }}"