Skip to content

Commit

Permalink
Merge pull request MLton#589 from MatthewFluet/sourceforge-release-wo…
Browse files Browse the repository at this point in the history
…rkflow

Create a GitHub action to automate creation of SourceForge release
  • Loading branch information
MatthewFluet authored Dec 30, 2024
2 parents 48e8f38 + 4127f6e commit 72e05fa
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
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/

0 comments on commit 72e05fa

Please sign in to comment.