kopia lustrzana https://github.com/JOSM/MapWithAI
Move release code to JOSMPluginAction repo
Signed-off-by: Taylor Smock <tsmock@meta.com>pull/20/head
rodzic
c88b05021c
commit
d5e455b9f7
|
@ -1,67 +0,0 @@
|
||||||
name: Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- v.**
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
tag:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
call-workflow:
|
|
||||||
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v1
|
|
||||||
with:
|
|
||||||
josm-revision: "r18589"
|
|
||||||
plugin-jar-name: 'mapwithai'
|
|
||||||
|
|
||||||
createrelease:
|
|
||||||
needs: call-workflow
|
|
||||||
name: Create Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set revision env variable
|
|
||||||
id: create_revision
|
|
||||||
run: |
|
|
||||||
if [[ ! -z "${{ inputs.tag }}" ]]; then
|
|
||||||
revision="${{ inputs.tag }}"
|
|
||||||
else
|
|
||||||
revision="${{ github.ref_name }}"
|
|
||||||
fi
|
|
||||||
echo "revision=$revision" >> $GITHUB_OUTPUT
|
|
||||||
echo "revision_number=${revision#v}" >> $GITHUB_OUTPUT
|
|
||||||
- name: Get build
|
|
||||||
id: cache-plugin-build
|
|
||||||
uses: actions/cache@v3.0.0
|
|
||||||
with:
|
|
||||||
key: ${{ github.event.repository.name }}-${{ github.sha }}-${{ steps.create_revision.outputs.revision_number }}
|
|
||||||
path: |
|
|
||||||
josm/dist/mapwithai.jar
|
|
||||||
josm/dist/mapwithai-javadoc.jar
|
|
||||||
josm/dist/mapwithai-sources.jar
|
|
||||||
- name: Generate update site
|
|
||||||
id: create_update_site
|
|
||||||
run: |
|
|
||||||
ls -R .
|
|
||||||
jarname="mapwithai.jar"
|
|
||||||
jarurl="https://github.com/${{ github.repository }}/releases/download/${{ steps.create_revision.outputs.revision }}/${jarname}"
|
|
||||||
echo "${jarname};$jarurl" > updatesite
|
|
||||||
unzip -p "josm/dist/${jarname}" META-INF/MANIFEST.MF | sed 's/^/\t/' >> updatesite
|
|
||||||
- name: Release
|
|
||||||
run: |
|
|
||||||
target="${{ steps.create_revision.outputs.revision }}"
|
|
||||||
if [ -z "$(gh --repo ${{ github.repository }} release view \"${target}\")" ]; then
|
|
||||||
gh release --repo ${{ github.repository }} create "${target}" \
|
|
||||||
--title "${target}" \
|
|
||||||
--latest \
|
|
||||||
--generate-notes
|
|
||||||
fi
|
|
||||||
gh release --repo ${{ github.repository }} upload --clobber "${target}" \
|
|
||||||
"josm/dist/mapwithai.jar" \
|
|
||||||
"josm/dist/mapwithai-javadoc.jar" \
|
|
||||||
"josm/dist/mapwithai-sources.jar" \
|
|
||||||
"updatesite"
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
|
@ -23,32 +23,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
josm-revision: ${{ matrix.josm-revision }}
|
josm-revision: ${{ matrix.josm-revision }}
|
||||||
plugin-jar-name: 'mapwithai'
|
plugin-jar-name: 'mapwithai'
|
||||||
createtag:
|
perform-revision-tagging: ${{ github.repository == 'JOSM/MapWithAI' && github.ref_type == 'branch' && github.ref_name == 'master' && github.event_name != 'schedule' && github.event_name != 'pull_request' }}
|
||||||
if: ${{ github.repository == 'JOSM/MapWithAI' && github.ref_type == 'branch' && github.ref_name == 'master' }}
|
|
||||||
needs: call-workflow
|
|
||||||
name: Create Tag
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
revision: ${{ steps.create_revision.outputs.revision }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set revision env variable
|
|
||||||
id: create_revision
|
|
||||||
# Count the total commits for this branch
|
|
||||||
run: |
|
|
||||||
revision="v$(git rev-list --count HEAD)"
|
|
||||||
git tag $revision
|
|
||||||
git push -u origin $revision
|
|
||||||
echo "revision=$revision" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
releasing:
|
|
||||||
needs: createtag
|
|
||||||
name: Run release actions
|
|
||||||
uses: ./.github/workflows/ant-release.yml
|
|
||||||
with:
|
|
||||||
tag: ${{ needs.createtag.outputs.revision }}
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue