-
Notifications
You must be signed in to change notification settings - Fork 18
51 lines (49 loc) · 2.27 KB
/
release-stable.yml
File metadata and controls
51 lines (49 loc) · 2.27 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
name: Release stable packages
on:
workflow_call:
inputs:
target_version:
description: 'Directory on the remote storage where the stable packages will be published'
required: false
type: string
workflow_dispatch:
inputs:
target_version:
description: 'Directory on the remote storage where the stable packages will be published'
required: false
type: string
jobs:
sync:
name: Moving dev packages to stable
runs-on: ubuntu-latest
env:
RCLONE_CONFIG_SPACES_TYPE: s3
RCLONE_CONFIG_SPACES_PROVIDER: DigitalOcean
RCLONE_CONFIG_SPACES_ENV_AUTH: false
RCLONE_CONFIG_SPACES_ACCESS_KEY_ID: ${{ secrets.DO_SPACE_ACCESS_KEY }}
RCLONE_CONFIG_SPACES_SECRET_ACCESS_KEY: ${{ secrets.DO_SPACE_SECRET_KEY }}
RCLONE_CONFIG_SPACES_ENDPOINT: ams3.digitaloceanspaces.com
RCLONE_CONFIG_SPACES_ACL: public-read
steps:
- uses: actions/checkout@v6
- name: Extract versions
id: versions
run: |
if [ -n "${{ github.event.inputs.target_version }}" ]; then
echo "::info::Using target version from input: ${{ github.event.inputs.target_version }}"
echo "TARGET_VERSION=${{ github.event.inputs.target_version }}" >> $GITHUB_OUTPUT
else
echo "::info::Using target version from build.conf.example"
echo "TARGET_VERSION=$(grep '^NETHSECURITY_VERSION=' build.conf.example | cut -d'=' -f2)" >> $GITHUB_OUTPUT
fi
echo "LAST_BUILD=$(curl -s -L https://updates.nethsecurity.nethserver.org/dev/latest_release)" >> $GITHUB_OUTPUT
- name: Setup rclone
uses: AnimMouse/setup-rclone@v1
- name: Copy dev packages to stable
run: |
if [ -z "${{ steps.versions.outputs.TARGET_VERSION }}" ]; then
echo "::error::TARGET_VERSION is not set. Aborting the workflow."
exit 1
fi
echo "::notice title='Publishing packages':: Publishing packages from ${{ steps.versions.outputs.LAST_BUILD }} to ${{ steps.versions.outputs.TARGET_VERSION }}"
rclone sync -M --no-update-modtime -v --exclude "/targets/**" "spaces:nethsecurity/dev/${{ steps.versions.outputs.LAST_BUILD }}/" "spaces:nethsecurity/stable/${{ steps.versions.outputs.TARGET_VERSION }}/"