-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (86 loc) · 2.83 KB
/
Copy pathbinaries.yml
File metadata and controls
103 lines (86 loc) · 2.83 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
---
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
name: binaries
"on":
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
tags:
- v*
permissions:
contents: write
jobs:
binaries:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.TOKEN_EXCHANGE_APP }}
private-key: ${{ secrets.TOKEN_EXCHANGE_KEY }}
permission-contents: write
permission-packages: write
- name: Checkout source
uses: actions/checkout@v6
- name: Configure aws
uses: aws-actions/configure-aws-credentials@v6
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Setup golang
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Setup task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup goreleaser
uses: goreleaser/goreleaser-action@v7
with:
install-only: true
- name: Setup signing
if: github.event_name != 'pull_request'
uses: crazy-max/ghaction-import-gpg@v7
with:
gpg_private_key: ${{ secrets.GNUPG_KEY }}
passphrase: ${{ secrets.GNUPG_PASSWORD }}
- name: Run release
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
task build:release
else
task build:snapshot
fi
- name: Upload version
if: startsWith(github.ref, 'refs/tags/')
run: |
aws s3 sync --exclude "*" --include "prom-to-apt-dater-*" dist s3://dl.webhippie.de/prom-to-apt-dater/${{ github.ref_name }}/
- name: Upload testing
if: startsWith(github.ref, 'refs/heads/')
run: |
aws s3 sync --exclude "*" --include "prom-to-apt-dater-*" dist s3://dl.webhippie.de/prom-to-apt-dater/testing/
- name: Install cloudsmith
if: startsWith(github.ref, 'refs/tags/')
uses: cloudsmith-io/cloudsmith-cli-action@v2.0.3
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
- name: Upload packages
if: startsWith(github.ref, 'refs/tags/')
run: |
for PACKAGE in dist/prom-to-apt-dater-*.deb; do
cloudsmith push deb webhippie/general/any-distro/any-version "${PACKAGE}"
done
for PACKAGE in dist/prom-to-apt-dater-*.rpm; do
cloudsmith push rpm webhippie/general/any-distro/any-version "${PACKAGE}"
done
...