Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a GitHub action to automate creation of SourceForge release #589

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ jobs:
with:
mlton-version: ${{ needs.mlton-version.outputs.mlton-version }}
secrets: inherit

sourceforge-release:
needs: [mlton-version, source-release, binary-release]
uses: ./.github/workflows/sourceforge-release.yml
with:
mlton-version: ${{ needs.mlton-version.outputs.mlton-version }}
secrets: inherit
44 changes: 44 additions & 0 deletions .github/workflows/sourceforge-release.yml
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/