-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (111 loc) · 4.91 KB
/
perl-deploy.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# This is a basic workflow to help you get started with Actions
name: perl-deploy-gpg
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
tags: '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ ( ( startsWith(matrix.os, 'ubuntu:') && 'ubuntu-latest' ) || ( startsWith(matrix.os, 'macos:') && 'macos-latest' ) || startsWith(matrix.os, 'windows:') && 'windows-latest' ) || matrix.os }}
env:
MM_SIGN_DIST: 1
TEST_SIGNATURE: 1
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ] # gpg redirection doesn't work from windows; only need to deploy once anyway [ 'windows-latest', 'ubuntu-latest' ]
perl: [ '5.32' ] # [ '5.12', '5.32', '5.34']
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Set up GPG per https://stackoverflow.com/a/66457517/5508606 ; updated by most recent example in action repo
- name: Import GPG Key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
# official example
- name: GPG user IDs
run: |
echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}"
echo "keyid: ${{ steps.import_gpg.outputs.keyid }}"
echo "name: ${{ steps.import_gpg.outputs.name }}"
echo "email: ${{ steps.import_gpg.outputs.email }}"
# trust myself
- name: Update Trust = Trust myself
id: trust_myself
run: |
# perl -le 'print for qw/trust 5 y quit/' | gpg --no-tty --command-fd 0 --edit-key 0x85FA5F2CF71E1CD6
gpg --no-tty --command-fd 0 --edit-key 0x85FA5F2CF71E1CD6 << EOTRUST
trust
5
y
quit
EOTRUST
- name: Set up perl ${{ matrix.perl }} ${{ matrix.os }} ${{ matrix.joblabel }}
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
multi-thread: ${{ ( ( startsWith(matrix.os, 'windows') || endsWith(matrix.os, ':thr') ) && true ) || false }}
distribution: ${{ ( endsWith(matrix.os, ':strawberry') && 'strawberry' ) || 'default' }}
- name: Pre-Makefile.PL prereqs for older perls
if: ${{ matrix.perl < '5.14' }}
run: |
cpanm --notest ExtUtils::MakeMaker
- name: Install pre-reqs
run: |
cpanm --notest Module::Signature
cpanm --notest File::Which File::Fetch File::Spec Archive::Extract
perl Makefile.PL
cpanm --notest --installdeps .
- name: Build & Sign
run: |
perl Makefile.PL
make
make distauthtest
make dist
make veryclean
- name: Variable Expriment
id: varex
run: |
# exporting doesn't help; variable must be used in same step as it is populated.
MYVAR=`ls *.tar.gz`
echo first MYVAR _ $MYVAR _
# https://github.community/t/how-to-set-action-env-variables-within-a-shell-script/18425
# echo "::set-env name=MYVAR::$MYVAR" ## The set-env command is disabled
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions
echo "::set-output name=MY_OUTPUT::$MYVAR"
- name: report the results of calculating the version
run: |
echo "the result is _ ${{ env.MYVAR }} _"
echo "the varex output is _ ${{ steps.varex.outputs.MY_OUTPUT }} _"
## get the name into the YML using the steps.varex.outputs.* syntax, so I can do file: and asset_name: correctly
- name: Store tarball as asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ steps.varex.outputs.MY_OUTPUT }}
asset_name: ${{ steps.varex.outputs.MY_OUTPUT }}
tag: ${{ github.ref }}
overwrite: true
body: "Some release text goes here, but only if this action was a branch that forces a tag"
# output
#- name: signed artifact
# uses: actions/upload-artifact@v2
# with:
# name: Makefile.Transport.asc
# path: ./Makefile.Transport.asc
# output
#- name: encrypted artifact
# uses: actions/upload-artifact@v2
# with:
# name: Makefile.encrypted.asc
# path: ./Makefile.encrypted.asc