fixed workflow #2
This file contains hidden or 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
| name: Release mit Datum & Latest | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Datum generieren | |
| id: date | |
| run: echo "TIMESTAMP=$(date +'%Y-%m-%d-%H%M')" >> $GITHUB_ENV | |
| - name: Zip erstellen | |
| run: | | |
| zip -r arcxp-plugin-${{ env.TIMESTAMP }}.zip components/chains/article-body/ components/features/TickarooLiveblogPowerUp/ content/sources/tickaroo-liveblog.js environmennt/index.json -x "*.git*" | |
| - name: Historisches Release erstellen | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.TIMESTAMP }} | |
| name: Release ${{ env.TIMESTAMP }} | |
| files: arcxp-plugin-${{ env.TIMESTAMP }}.zip | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update 'latest' tag | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| try { | |
| await github.rest.git.deleteRef({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: "tags/latest" | |
| }) | |
| } catch (e) { | |
| console.log("Tag latest existierte noch nicht oder konnte nicht gelöscht werden.") | |
| } | |
| await github.rest.git.createRef({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: "refs/tags/latest", | |
| sha: context.sha | |
| }) | |
| - name: Update 'Latest' Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: latest | |
| name: Latest Build | |
| files: arcxp-plugin-${{ env.TIMESTAMP }}.zip | |
| make_latest: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |