-
Notifications
You must be signed in to change notification settings - Fork 311
85 lines (82 loc) · 3.38 KB
/
release-rc.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
name: Release-candidate release
on:
workflow_dispatch:
inputs:
rc_version:
description: RC version (integer)
required: true
env:
NODE_ENV: production
jobs:
release:
name: Release-candidate release
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check branch
run: echo "${{ github.ref_name }}" | grep -Pq '^release/v3\.\d+\.\d+$'
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: Install Go and Dependencies
uses: ./.github/actions/install-go-and-deps
- name: Build Mage
uses: ./.github/actions/build-mage
- name: Install Node and Dependencies
uses: ./.github/actions/install-node-and-deps
- name: Initialize device repository index cache
id: dr-index-cache
uses: actions/cache@v4
with:
path: data/lorawan-devices-index
key: dr-index-cache-${{ hashFiles('data/lorawan-devices') }}
- name: Create device repository index
run: tools/bin/mage dev:initDeviceRepo
if: steps.dr-index-cache.outputs.cache-hit != 'true'
- name: Build Frontend
uses: ./.github/actions/build-frontend
with:
production-sourcemaps: "true"
- name: Check for diff
run: tools/bin/mage git:diff
- name: Import the signing key
run: |
printf '%s' '${{ secrets.SIGNATURE_PASSPHRASE }}' >/tmp/gpg_passphrase
cat /tmp/gpg_passphrase | gpg --passphrase-fd 0 --no-tty --batch --import gpg_signing_key
- name: Determine version
id: version
run: |
export RC_VERSION=${{ format('{0}-rc{1}', github.ref_name, github.event.inputs.rc_version) }}
export RC_VERSION=${RC_VERSION#release/v}
echo "rc_version=$RC_VERSION" >> $GITHUB_OUTPUT
- name: Run Goreleaser
uses: goreleaser/goreleaser-action@v5
with:
version: "v1.18.2"
args: release --config .goreleaser.snapshot.yml --snapshot --timeout 60m
env:
SIGN_KEY_NAME: ${{ secrets.SIGN_KEY_NAME }}
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.rc_version }}
- name: Tag and Push Docker images
run: |
docker tag lorawan-stack-dev:${{ github.sha }}-amd64 ${DOCKER_PREFIX}/lorawan-stack-dev:${RC_VERSION}-amd64
docker tag lorawan-stack-dev:${{ github.sha }}-arm64 ${DOCKER_PREFIX}/lorawan-stack-dev:${RC_VERSION}-arm64
docker push ${DOCKER_PREFIX}/lorawan-stack-dev:${RC_VERSION}-amd64
docker push ${DOCKER_PREFIX}/lorawan-stack-dev:${RC_VERSION}-arm64
docker manifest create ${DOCKER_PREFIX}/lorawan-stack-dev:${RC_VERSION} ${DOCKER_PREFIX}/lorawan-stack-dev:${RC_VERSION}-amd64 ${DOCKER_PREFIX}/lorawan-stack-dev:${RC_VERSION}-arm64
docker manifest push ${DOCKER_PREFIX}/lorawan-stack-dev:${RC_VERSION}
env:
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_PREFIX: thethingsnetwork
RC_VERSION: ${{ steps.version.outputs.rc_version }}