Release #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Copy release to the mirror | |
on: | |
release: | |
types: [edited] | |
workflow_dispatch: | |
inputs: | |
release-tag: | |
description: 'Release tag' | |
required: true | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
download_dir: download | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
name: Copy release to the mirror | |
environment: | |
name: stable-mirror | |
url: https://release.manjaro.download | |
strategy: | |
matrix: | |
edition: | |
- kde | |
- xfce | |
- gnome | |
- i3 | |
- cinnamon | |
- sway | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
- name: download & extract release assets | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release view ${{ inputs.release-tag || github.event.release.tag_name }} --json assets --jq '[[.assets[]][] | select(.name | contains("-${{ matrix.edition }}-")) | select(.name | contains("-unstable-") | not) | select(.name | contains("-testing-") | not)] | sort_by(.name)' >docs/assets.json | |
mkdir -p $download_dir | |
for url in $(cat docs/assets.json | jq -r '.[].url'); do | |
wget -q -P $download_dir $url | |
echo downloaded $url | |
done | |
# unzip files | |
for file in $download_dir/*.iso.zip; do | |
zip -FF $file --out manjaro-full.zip && unzip manjaro-full.zip -d $download_dir/ | |
echo unzipped $file | |
done | |
## remove unzipped files | |
rm -f $download_dir/*.zip || echo ok | |
rm -f $download_dir/*.z01 || echo ok | |
du -h $download_dir | |
ls $download_dirlatest | |
- name: create edition release file-list | |
id: files | |
run: | | |
(cd $download_dir && ls -l *iso*) | \ | |
jq --compact-output -s -R 'split("\n") | [.[] | select(length > 0) | split(" ") | [.[] | select(. == "" | not)] | { size: .[4] | tonumber, name: .[-1], url: "https://r2.manjaro.download/latest/\(.[-1])" }]' \ | |
> $download_dir/release.json | |
echo "list=$(cat $download_dir/release.json)" >> $GITHUB_OUTPUT | |
- uses: cloudposse/github-action-matrix-outputs-write@v1 | |
id: out | |
with: | |
matrix-step-name: ${{ github.job }} | |
matrix-key: ${{ matrix.edition }} | |
outputs: ${{ steps.files.outputs.list }} | |
- name: s3 upload | |
id: s3 | |
run: echo "Uploading to s3" | |
release: | |
runs-on: ubuntu-latest | |
needs: mirror | |
steps: | |
- uses: cloudposse/github-action-matrix-outputs-read@v1 | |
id: read | |
with: | |
matrix-step-name: mirror | |
- run: echo "${{ steps.read.outputs.result }}" |