forked from jonfriesen/buildpack-apt
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2.31 KB
/
pr.yaml
File metadata and controls
75 lines (63 loc) · 2.31 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
name: pr
permissions:
pull-requests: 'write'
on:
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Setup golang
uses: actions/setup-go@v2
with:
go-version: '^1.19.1'
id: go
- name: Install shellcheck
run: |
mkdir /tmp/shellcheck \
&& curl -Ls "https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz" \
| tar vxJf - -C /tmp/shellcheck
echo "/tmp/shellcheck/shellcheck-v0.7.1" >> $GITHUB_PATH
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Test
run: dev/test -v
- name: E2E Test
run: docker run -v ${PWD}/bin:/buildpack-apt -v ${PWD}/e2e/e2e.sh:/e2e/e2e.sh ubuntu:22.04 /e2e/e2e.sh
- name: Setup package variables
run: |
export GIT_HASH=$(git rev-parse --short HEAD)
export VERSION=${{ github.event.number }}
export BP_FILENAME=buildpack-apt-$VERSION.tgz
export BP_URL=https://${{ secrets.PR_SPACES_BUCKET }}.${{ secrets.SPACES_REGION }}.digitaloceanspaces.com/$BP_FILENAME
export BP_TOML_VERSION=$(sed -n 's/^version = \"\(.*\)\"/\1/p' buildpack.toml)
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "BP_FILENAME=$BP_FILENAME" >> $GITHUB_ENV
echo "BP_URL=$BP_URL" >> $GITHUB_ENV
echo "BP_TOML_VERSION=$BP_TOML_VERSION" >> $GITHUB_ENV
- name: Make dev release
run: |
export VERSION=${{ env.VERSION }}
make release
- name: DigitalOcean Spaces Upload actions
timeout-minutes: 5
uses: BetaHuhn/do-spaces-action@v2.0.1
with:
access_key: ${{ secrets.KEY_ID }}
secret_key: ${{ secrets.SECRET_ACCESS_KEY }}
space_name: ${{ secrets.PR_SPACES_BUCKET }}
space_region: ${{ secrets.SPACES_REGION }}
source: ${{ env.BP_FILENAME }}
- uses: actions/github-script@v5
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '📦 `${{ env.BP_FILENAME }}` - `${{ env.BP_TOML_VERSION }}` (`${{ env.GIT_HASH }}`)\n🔗 ${{ env.BP_URL }}'
})