Skip to content

Commit 6439876

Browse files
authored
fix CI publish-artifacts action and release based on tags (#13)
1 parent 476a010 commit 6439876

File tree

3 files changed

+78
-91
lines changed

3 files changed

+78
-91
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ jobs:
231231
run: make vendor vendor.check
232232

233233
- name: Build Artifacts
234-
run: make -j2 build.all
234+
run: make -j2 -i build.all
235235
env:
236236
# We're using docker buildx, which doesn't actually load the images it
237237
# builds by default. Specifying --load does so.

.github/workflows/release.yaml

-86
This file was deleted.

.github/workflows/tag.yml

+77-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tag
1+
name: Tag release
22

33
on:
44
workflow_dispatch:
@@ -11,9 +11,10 @@ on:
1111
required: true
1212

1313
jobs:
14-
create-tag:
14+
create-tag-build-and-pack:
1515
runs-on: ubuntu-22.04
16-
16+
permissions:
17+
contents: write
1718
steps:
1819
- name: Checkout
1920
uses: actions/checkout@v2
@@ -23,4 +24,76 @@ jobs:
2324
with:
2425
version: ${{ github.event.inputs.version }}
2526
message: ${{ github.event.inputs.message }}
26-
token: ${{ secrets.GITHUB_TOKEN }}
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: CR authentication
30+
uses: docker/login-action@v2
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.ACCESS_TOKEN }}
35+
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
with:
39+
fetch-depth: 2
40+
- name: Configure Git
41+
run: |
42+
git config user.name "$GITHUB_ACTOR"
43+
git config user.email "$GITHUB_ACTOR@github.com"
44+
45+
- name: Set VERSION env
46+
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
47+
48+
- name: Setup QEMU
49+
uses: docker/setup-qemu-action@v1
50+
with:
51+
platforms: all
52+
53+
- name: Setup Docker Buildx
54+
uses: docker/setup-buildx-action@v1
55+
with:
56+
version: ${{ env.DOCKER_BUILDX_VERSION }}
57+
install: true
58+
59+
- name: Setup Go
60+
uses: actions/setup-go@v2
61+
with:
62+
go-version: ${{ env.GO_VERSION }}
63+
64+
- name: Find the Go Build Cache
65+
id: go
66+
run: echo "::set-output name=cache::$(make go.cachedir)"
67+
68+
- name: Cache the Go Build Cache
69+
uses: actions/cache@v2
70+
with:
71+
path: ${{ steps.go.outputs.cache }}
72+
key: ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }}
73+
restore-keys: ${{ runner.os }}-build-publish-artifacts-
74+
75+
- name: Cache Go Dependencies
76+
uses: actions/cache@v2
77+
with:
78+
path: .work/pkg
79+
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
80+
restore-keys: ${{ runner.os }}-pkg-
81+
82+
- name: Vendor Dependencies
83+
run: make vendor vendor.check
84+
85+
- name: Get make submodules
86+
run: make submodules
87+
88+
- name: Process swagger.json
89+
run: make process.scheme
90+
91+
- name: Install crossplane CLI
92+
id: crossplane
93+
run: curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh" | sh
94+
95+
- name: Build provider image
96+
run: docker build -t ${REGISTRY}/${{ github.repository }}/provider-magento:${{ env.VERSION }} ./cluster
97+
98+
- name: Build and push crossplane packages
99+
run: ./crossplane xpkg build -f package -o provider-magento --embed-runtime-image ${REGISTRY}/${{ github.repository }}/provider-magento:${{ env.VERSION }} && ./crossplane xpkg push -f provider-magento ${REGISTRY}/${{ github.repository }}/provider-magento:${{ env.VERSION }};

0 commit comments

Comments
 (0)