name: release run-name: ${{ gitea.actor }} release MouseSoft Draw.IO Export on: push: tags: - "v*" jobs: build: runs-on: ubuntu-latest outputs: artifact_amd64: ${{ steps.build-amd.outputs.ARTIFACT }} artifact_arm64: ${{ steps.build-arm.outputs.ARTIFACT }} steps: - name: check-out repository code uses: https://gitea.com/actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true - name: set-up go uses: https://gitea.com/actions/setup-go@v3 with: go-version: ">=1.22" - name: set-up dependencies run: make clean vendor - name: test run: make lint test - name: build amd64 package id: build-amd run: | echo "ARTIFACT=drawio-export-$(make version)_$(go env GOOS)-amd64" >> $GITHUB_OUTPUT GOARCH=amd64 make clean build package - name: upload amd64 package uses: https://gitea.com/actions/upload-artifact@v3 with: name: ${{ steps.build-amd.outputs.ARTIFACT }} path: | out/*.changes out/*.deb overwrite: true - name: build arm64 package id: build-arm run: | echo "ARTIFACT=drawio-export-$(make version)_$(go env GOOS)-arm64" >> $GITHUB_OUTPUT GOARCH=arm64 make clean build package - name: upload arm64 package uses: https://gitea.com/actions/upload-artifact@v3 with: name: ${{ steps.build-arm.outputs.ARTIFACT }} path: | out/*.changes out/*.deb overwrite: true build_windows: runs-on: windows outputs: artifact: ${{ steps.build.outputs.ARTIFACT }} defaults: run: shell: bash steps: - name: check-out repository code uses: https://gitea.com/actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true - name: set-up dependencies run: make vendor - name: build id: build run: | echo "ARTIFACT=drawio-export-$(make version)_$(go env GOOS)-$(go env GOARCH)" >> $GITHUB_OUTPUT make clean build package - name: upload artifact uses: https://gitea.com/actions/upload-artifact@v3 with: name: ${{ steps.build.outputs.ARTIFACT }} path: out/*.msi overwrite: true deploy: runs-on: ubuntu-latest outputs: version: ${{ steps.meta.outputs.VERSION }} changes: ${{ steps.meta.outputs.CHANGES }} needs: - build steps: - name: check-out repository code uses: https://gitea.com/actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true - name: get meta-data id: meta run: | echo "VERSION=$(make version)" >> $GITHUB_OUTPUT echo 'CHANGES<> $GITHUB_OUTPUT gawk -f scripts/changes.awk -v version=$(make version-number) CHANGELOG.md >> $GITHUB_OUTPUT echo EOF >> $GITHUB_OUTPUT - name: download debian amd64 package uses: https://gitea.com/actions/download-artifact@v4 with: name: ${{ needs.build.outputs.artifact_amd64 }} path: out/ - name: download debian ard64 package uses: https://gitea.com/actions/download-artifact@v4 with: name: ${{ needs.build.outputs.artifact_arm64 }} path: out/ - name: deploy debian packages env: SSH_HOST: ${{ secrets.DEB_SSH_HOST }} SSH_PORT: ${{ secrets.DEB_SSH_PORT }} SSH_USER: ${{ secrets.DEB_SSH_USER }} SSH_KEY: ${{ secrets.DEB_SSH_KEY }} run: | sed -e "s/DEB_SSH_HOST/$SSH_HOST/g" deploy/dput/mousesoft.json.tpl > /etc/dput.d/profiles/mousesoft.json mkdir -p ~/.ssh/ echo "$SSH_KEY" | tr -d '\r' > ~/.ssh/key chmod 0600 ~/.ssh/key cat >>~/.ssh/config <