forked from MLton/mlton
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a GitHub action to automate creation of SourceForge release
- Loading branch information
1 parent
48e8f38
commit 4127f6e
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: SourceForge Release | ||
|
||
on | ||
workflow_dispatch: | ||
inputs: | ||
mlton-version: | ||
required: true | ||
type: string | ||
workflow_call: | ||
inputs: | ||
mlton-version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
sourceforge-release: | ||
runs-on: ubuntu-24.04 | ||
env: | ||
SSH_KEY_RSA: ${{ secrets.MLTON_WEBMASTER_SSH_KEY_RSA }} | ||
SSH_KEY_ED25519: ${{ secrets.MLTON_WEBMASTER_SSH_KEY_ED25519 }} | ||
SSH_CONFIG: ${{ secrets.MLTON_WEBMASTER_SSH_CONFIG }} | ||
SSH_KNOWN_HOSTS: ${{ secrets.MLTON_WEBMASTER_SSH_KNOWN_HOSTS }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: .github | ||
ref: ${{ inputs.checkout-ref || 'master' }} | ||
- name: Download release assets | ||
run: gh release download on-${{ inputs.mlton-version }}-release --dir assets --pattern '*' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create SourceForge release directory | ||
run: sftp -b <(echo "-mkdir ${{ inputs.mlton-version }}") mlton-webmaster,[email protected]:/home/frs/project/mlton/mlton | ||
- name: Upload release assets to SourceForge | ||
run: rsync -azP --delete -e ssh assets/ mlton-webmaster,[email protected]:/home/frs/project/mlton/mlton/${{ inputs.mlton-version }}/ | ||
- name: Upload release guide to SourceForge | ||
run: | | ||
tar xzf assets/mlton-${{ inputs.mlton-version }}.src.tgz | ||
cd mlton-${{ inputs.mlton-version }}/doc/guide | ||
mv localhost ${{ inputs.mlton-version }} | ||
tar czf guide-${{ inputs.mlton-version }}.tgz ${{ inputs.mlton-version }} | ||
rsync -azP --delete -e ssh ${{ inputs.mlton-version }} mlton-webmaster,[email protected]:/home/project-web/mlton/htdocs/guide/ | ||
rsync -azP --delete -e ssh guide-${{ inputs.mlton-version }} mlton-webmaster,[email protected]:/home/project-web/mlton/htdocs/guide/ |