-
Notifications
You must be signed in to change notification settings - Fork 7
101 lines (89 loc) · 3.21 KB
/
_compile.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
name: Compile for PowerPC
on:
workflow_call:
inputs:
git_tag:
description: 'Git tag to use'
required: true
type: string
gcc:
description: 'GCC version to use'
required: true
default: 11
type: string
spe:
description: 'Compile with SPE'
required: false
default: "no"
type: string
env:
archive_name: clib4-${{ inputs.git_tag }}${{ inputs.spe == 'yes' && '_SPE' || '' }}
jobs:
compile:
runs-on: ubuntu-latest
container:
image: walkero/amigagccondocker:os4-gcc${{ inputs.gcc }}
volumes:
- '${{ github.workspace }}:/opt/code'
steps:
- name: Pull code
uses: actions/checkout@v4
- name: Add repository to git safe directories
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory /opt/code
- name: Compile clib4
uses: ./.github/actions/compile
with:
git_tag: ${{ inputs.git_tag }}
spe: ${{ inputs.spe }}
- name: Create the LHA release archive
run: |
make -f GNUmakefile.os4 release && \
mv clib4.lha ${{ env.archive_name }}.lha
- name: Create the DEB release archive
run: |
make -f GNUmakefile.os4 dpkg DPKG_LIB=${{ env.archive_name }}_amd64
- name: Upload LHA release file in GitHub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /opt/code/${{ env.archive_name }}.lha
asset_name: ${{ env.archive_name }}.lha
asset_content_type: application/x-lzh-compressed
- name: Install GitHub binary
uses: ./.github/actions/install-gh
- name: Upload DEB release file in GitHub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /opt/code/${{ env.archive_name }}_amd64.deb
asset_name: ${{ env.archive_name }}_amd64.deb
asset_content_type: application/vnd.debian.binary-pac
- name: Upload DEB release file to the server
uses: kostya-ten/ssh-server-deploy@v4
with:
host: ${{ secrets.DEBSERVER_HOST }}
port: ${{ secrets.DEBSERVER_PORT }}
username: ${{ secrets.DEBSERVER_USERNAME }}
private_key: ${{ secrets.DEBSERVER_PRIVATE_KEY }}
scp_source: ${{ env.archive_name }}.deb
scp_target: /opt/amigarepo/ubuntu/pool/main
before_script: |
rm /opt/amigarepo/ubuntu/pool/main/${{ env.archive_name }}.deb
after_script: |
/root/regenerate-packages.sh
- name: Create Pull Request
if: ${{ inputs.spe == 'no' }}
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Release ${{ inputs.git_tag }} changes
branch: release/${{ inputs.git_tag }}
base: master
body: Automated changes as part of the release
title: Version files changes by the github bot