-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (51 loc) · 1.72 KB
/
main.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
name: Build project
on:
push:
tags:
- '*'
branches:
- master
pull_request:
branches:
- master
jobs:
project:
runs-on: ubuntu-latest
steps:
- name: Retrieve the source code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Build the archive
run: |
source $CONDA/bin/activate
conda install -y anaconda-project nodejs
npm install -g mdpdf
sed -i.bak -E 's@(extensions:.*)@simpleLineBreaks: false, \1@' $(npm root -g)/mdpdf/src/index.js
echo ".markdown-body { font-size: 11pt; }" > ../style.css
mdpdf README.md --format=letter --style=../style.css --gh-style
mdpdf TOOLS.md --format=letter --style=../style.css --gh-style
anaconda-project archive rstudio-installer.tar.bz2
- name: Upload archive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}}
run: |
SUFFFIX2="no"
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
SUFFIX=-$GITHUB_REF_NAME
SUFFIX2=""
elif [ -z "$GITHUB_HEAD_REF" ]; then
SUFFIX=-dev
else
SUFFIX=-test
fi
URL=s3://airgap-svc/misc
ARGS="--acl public-read --region $AWS_DEFAULT_REGION"
for sfx in "$SUFFIX" "$SUFFIX2"; do
aws s3 cp rstudio-installer.tar.bz2 $URL/rstudio-installer$sfx.tar.bz2 $ARGS
aws s3 cp README.pdf $URL/rstudio-install$sfx.pdf $ARGS
aws s3 cp TOOLS.pdf $URL/tools-volume$sfx.pdf $ARGS
if [ "$SUFFIX2" = "no" ]; then break; fi
done