Skip to content

Commit

Permalink
🧑‍💻 Add basic release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
boredland committed May 13, 2024
1 parent d7f5b08 commit 997dc66
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Copy release to the mirror

on:
release:
types: [edited]
workflow_dispatch:
inputs:
release-tag:
description: 'Release tag'
required: true
default: 'latest'

concurrency:
group: "mirror"
cancel-in-progress: true

env:
download_dir: download

jobs:
release:
runs-on: ubuntu-latest
name: Copy release to the mirror
environment:
name: stable-mirror
url: https://release.manjaro.download
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("-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
if [[ $url == *".iso.zip"* ]]; then
# 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
fi
done
du -h $download_dir
ls $download_dir
- name: create release filelist
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/\(.[-1])" }]' \
> $download_dir/release.json
Empty file added docs/.gitkeep
Empty file.

0 comments on commit 997dc66

Please sign in to comment.