-
Notifications
You must be signed in to change notification settings - Fork 13
55 lines (52 loc) · 1.81 KB
/
release.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
name: 🚀 Release
on:
push:
tags: [v*]
jobs:
release:
name: 🚀 Release
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
- name: Install Release Dependencies
run: cpanm -qn Module::Build CPAN::Uploader
# CPAN
- name: Package the Release
id: package
run: perl Build.PL && ./Build manifest && ./Build dist && echo "tarball=$(./Build tarball_name )" >> $GITHUB_OUTPUT
- name: Generate Release Changes
run: ./Build latest_changes
- name: Release on CPAN
env:
CPANPASS: ${{ secrets.CPAN_PASSWORD }}
run: cpan-upload --user DWHEELER --password "$CPANPASS" '${{ steps.package.outputs.tarball }}'
# Docker
- name: Build Image
run: docker build --pull -t ${{ secrets.DOCKER_USER }}/pg_prove:latest -t ${{ secrets.DOCKER_USER }}/pg_prove:${{ github.ref_name }} -f dist/Dockerfile .
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Push the Image
run: docker push -a ${{ secrets.DOCKER_USER }}/pg_prove
# GitHub
- name: Create GitHub Release
id: release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: latest_changes.md
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./${{ steps.package.outputs.tarball }}
asset_name: ${{ steps.package.outputs.tarball }}
asset_content_type: application/gzip